diff options
| author | Mads Jensen <mje@inducks.org> | 2017-03-09 16:17:41 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-06-28 14:07:55 -0400 |
| commit | 550cb3a365dee4edfdd1563224d5304de2a57fda (patch) | |
| tree | fb532f38774ff7619edd2a4532c3daae1ee0ac5a /tests/bash_completion | |
| parent | 43a4835edf32c57eb74c0eb207c276734a34abcf (diff) | |
| download | django-550cb3a365dee4edfdd1563224d5304de2a57fda.tar.gz | |
Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().
Diffstat (limited to 'tests/bash_completion')
| -rw-r--r-- | tests/bash_completion/tests.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/bash_completion/tests.py b/tests/bash_completion/tests.py index 1d35e1f28e..ba2a5ea773 100644 --- a/tests/bash_completion/tests.py +++ b/tests/bash_completion/tests.py @@ -4,6 +4,7 @@ A series of tests to establish that the command-line bash completion works. import os import sys import unittest +from contextlib import suppress from django.apps import apps from django.core.management import ManagementUtility @@ -50,10 +51,8 @@ class BashCompletionTests(unittest.TestCase): def _run_autocomplete(self): util = ManagementUtility(argv=sys.argv) with captured_stdout() as stdout: - try: + with suppress(SystemExit): util.autocomplete() - except SystemExit: - pass return stdout.getvalue().strip().split('\n') def test_django_admin_py(self): |
