babel/Skip-tests-involving-freezegun-module-which-we-re-no.patch

161 lines
6.5 KiB
Diff
Raw Normal View History

From 5dfa1057b809f9bf848916a1001c742cf5229f46 Mon Sep 17 00:00:00 2001
From: Tomas Orsava <torsava@redhat.com>
Date: Mon, 18 Jun 2018 15:14:52 +0200
Subject: [PATCH] Skip tests involving freezegun module which we're not
shipping
---
tests/messages/test_frontend.py | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py
index 20904a3..236dd5c 100644
--- a/tests/messages/test_frontend.py
+++ b/tests/messages/test_frontend.py
@@ -11,7 +11,6 @@
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://babel.edgewall.org/log/.
import shlex
-from freezegun import freeze_time
from datetime import datetime
from distutils.dist import Distribution
from distutils.errors import DistutilsOptionError
@@ -150,7 +149,7 @@ class ExtractMessagesTestCase(unittest.TestCase):
self.cmd.output_file = self._pot_file()
self.assertRaises(DistutilsOptionError, self.cmd.finalize_options)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extraction_with_default_mapping(self):
self.cmd.copyright_holder = 'FooBar, Inc.'
self.cmd.msgid_bugs_address = 'bugs.address@email.tld'
@@ -208,7 +207,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extraction_with_mapping_file(self):
self.cmd.copyright_holder = 'FooBar, Inc.'
self.cmd.msgid_bugs_address = 'bugs.address@email.tld'
@@ -261,7 +260,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extraction_with_mapping_dict(self):
self.dist.message_extractors = {
'project': [
@@ -392,7 +391,7 @@ class InitCatalogTestCase(unittest.TestCase):
self.cmd.output_file = 'dummy'
self.assertRaises(DistutilsOptionError, self.cmd.finalize_options)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_with_output_dir(self):
self.cmd.input_file = 'project/i18n/messages.pot'
self.cmd.locale = 'en_US'
@@ -444,7 +443,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_keeps_catalog_non_fuzzy(self):
self.cmd.input_file = 'project/i18n/messages_non_fuzzy.pot'
self.cmd.locale = 'en_US'
@@ -496,7 +495,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_correct_init_more_than_2_plurals(self):
self.cmd.input_file = 'project/i18n/messages.pot'
self.cmd.locale = 'lv_LV'
@@ -550,7 +549,7 @@ msgstr[2] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_correct_init_singular_plural_forms(self):
self.cmd.input_file = 'project/i18n/messages.pot'
self.cmd.locale = 'ja_JP'
@@ -601,7 +600,7 @@ msgstr[0] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_supports_no_wrap(self):
self.cmd.input_file = 'project/i18n/long_messages.pot'
self.cmd.locale = 'en_US'
@@ -662,7 +661,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_supports_width(self):
self.cmd.input_file = 'project/i18n/long_messages.pot'
self.cmd.locale = 'en_US'
@@ -827,7 +826,7 @@ commands:
def assert_pot_file_exists(self):
assert os.path.isfile(self._pot_file())
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extract_with_default_mapping(self):
pot_file = self._pot_file()
self.cli.run(sys.argv + ['extract',
@@ -883,7 +882,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extract_with_mapping_file(self):
pot_file = self._pot_file()
self.cli.run(sys.argv + ['extract',
@@ -934,7 +933,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_extract_with_exact_file(self):
"""Tests that we can call extract with a particular file and only
strings from that file get extracted. (Note the absence of strings from file1.py)
@@ -983,7 +982,7 @@ msgstr[1] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_init_with_output_dir(self):
po_file = self._po_file('en_US')
self.cli.run(sys.argv + ['init',
@@ -1034,7 +1033,7 @@ msgstr[1] ""
def _i18n_dir(self):
return os.path.join(self.datadir, 'project', 'i18n')
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_init_singular_plural_forms(self):
po_file = self._po_file('ja_JP')
self.cli.run(sys.argv + ['init',
@@ -1081,7 +1080,7 @@ msgstr[0] ""
actual_content = f.read()
self.assertEqual(expected_content, actual_content)
- @freeze_time("1994-11-11")
+ @pytest.mark.skip(reason="Not shipping the freezegun module")
def test_init_more_than_2_plural_forms(self):
po_file = self._po_file('lv_LV')
self.cli.run(sys.argv + ['init',
--
2.14.4