Replaced 'raise SkipTest' with self.skipTest() in a few tests.

This commit is contained in:
Tim Graham 2016-08-16 16:42:27 -04:00 committed by GitHub
parent 4f5b7eeb53
commit 5a41ca79dc
3 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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):