summaryrefslogtreecommitdiff
path: root/tests/runtests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runtests.py')
-rwxr-xr-xtests/runtests.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/runtests.py b/tests/runtests.py
index 08e53f4cb1..7f4f1670c5 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -8,7 +8,6 @@ import subprocess
import sys
import tempfile
import warnings
-from contextlib import suppress
import django
from django.apps import apps
@@ -316,8 +315,10 @@ def bisect_tests(bisection_label, options, test_labels, parallel):
# Make sure the bisection point isn't in the test list
# Also remove tests that need to be run in specific combinations
for label in [bisection_label, 'model_inheritance_same_model_name']:
- with suppress(ValueError):
+ try:
test_labels.remove(label)
+ except ValueError:
+ pass
subprocess_args = get_subprocess_args(options)
@@ -365,8 +366,10 @@ def paired_tests(paired_test, options, test_labels, parallel):
# Make sure the constant member of the pair isn't in the test list
# Also remove tests that need to be run in specific combinations
for label in [paired_test, 'model_inheritance_same_model_name']:
- with suppress(ValueError):
+ try:
test_labels.remove(label)
+ except ValueError:
+ pass
subprocess_args = get_subprocess_args(options)