diff options
| author | Tim Graham <timograham@gmail.com> | 2016-06-28 11:21:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-28 11:21:26 -0400 |
| commit | c9ae09addffb839403312131d4251e9d8b454508 (patch) | |
| tree | 74913fbe2e90d88e094f8594947ebf313ec5f12f /tests/check_framework | |
| parent | c1b6f554e405fe733e8d80f7e3d77c277810e707 (diff) | |
Replaced use of TestCase.fail() with assertRaises().
Also removed try/except/fail antipattern that hides exceptions.
Diffstat (limited to 'tests/check_framework')
| -rw-r--r-- | tests/check_framework/tests.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/check_framework/tests.py b/tests/check_framework/tests.py index 6e4115140a..e57e824ecb 100644 --- a/tests/check_framework/tests.py +++ b/tests/check_framework/tests.py @@ -224,10 +224,7 @@ class SilencingCheckTests(SimpleTestCase): def test_silenced_error(self): out = StringIO() err = StringIO() - try: - call_command('check', stdout=out, stderr=err) - except CommandError: - self.fail("The mycheck.E001 check should be silenced.") + call_command('check', stdout=out, stderr=err) self.assertEqual(out.getvalue(), 'System check identified no issues (1 silenced).\n') self.assertEqual(err.getvalue(), '') @@ -236,11 +233,7 @@ class SilencingCheckTests(SimpleTestCase): def test_silenced_warning(self): out = StringIO() err = StringIO() - try: - call_command('check', stdout=out, stderr=err) - except CommandError: - self.fail("The mycheck.E001 check should be silenced.") - + call_command('check', stdout=out, stderr=err) self.assertEqual(out.getvalue(), 'System check identified no issues (1 silenced).\n') self.assertEqual(err.getvalue(), '') |
