diff --git a/tests/i18n/test_compilation.py b/tests/i18n/test_compilation.py index ac2d468f3e..b33338800a 100644 --- a/tests/i18n/test_compilation.py +++ b/tests/i18n/test_compilation.py @@ -156,7 +156,7 @@ class CompilationErrorHandling(MessageCompilationTests): else: cmd = MakeMessagesCommand() if cmd.gettext_version < (0, 18, 3): - raise unittest.SkipTest("python-brace-format is a recent gettext addition.") + self.skipTest("python-brace-format is a recent gettext addition.") with self.assertRaisesMessage(CommandError, "' cannot start a field name"): call_command('compilemessages', locale=['ko'], verbosity=0) diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py index 3433c1944b..5ea574530f 100644 --- a/tests/i18n/test_extraction.py +++ b/tests/i18n/test_extraction.py @@ -7,7 +7,7 @@ import re import shutil import time import warnings -from unittest import SkipTest, skipUnless +from unittest import skipUnless from django.core import management from django.core.management import execute_from_command_line @@ -498,7 +498,7 @@ class SymlinkExtractorTests(ExtractorTests): try: os.symlink(os.path.join(self.test_dir, 'templates'), self.symlinked_dir) except (OSError, NotImplementedError): - raise SkipTest("os.symlink() is available on this OS but can't be used by this user.") + self.skipTest("os.symlink() is available on this OS but can't be used by this user.") os.chdir(self.test_dir) management.call_command('makemessages', locale=[LOCALE], verbosity=0, symlinks=True) self.assertTrue(os.path.exists(self.PO_FILE)) @@ -507,7 +507,7 @@ class SymlinkExtractorTests(ExtractorTests): self.assertMsgId('This literal should be included.', po_contents) self.assertLocationCommentPresent(self.PO_FILE, None, 'templates_symlinked', 'test.html') else: - raise SkipTest("os.symlink() not available on this OS + Python version combination.") + self.skipTest("os.symlink() not available on this OS + Python version combination.") class CopyPluralFormsExtractorTests(ExtractorTests): diff --git a/tests/utils_tests/test_timezone.py b/tests/utils_tests/test_timezone.py index 072e4b699d..5f21c06bae 100644 --- a/tests/utils_tests/test_timezone.py +++ b/tests/utils_tests/test_timezone.py @@ -46,7 +46,7 @@ class TimezoneTests(SimpleTestCase): except (OverflowError, ValueError) as exc: self.assertIn("install pytz", exc.args[0]) else: - raise unittest.SkipTest("Failed to trigger an OverflowError or ValueError") + self.skipTest("Failed to trigger an OverflowError or ValueError") def test_now(self): with override_settings(USE_TZ=True):