summaryrefslogtreecommitdiff
path: root/tests/runtests.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2021-06-05 07:46:37 -0700
committerGitHub <noreply@github.com>2021-06-05 16:46:37 +0200
commit9812b486b5237933559c1bea8a11eff2b0d2af49 (patch)
tree53af73874f3e7035b88ca51d784b551f7b57d3cf /tests/runtests.py
parentd6f3b5858991e9609eaefc139dc605b36f9a07b3 (diff)
downloaddjango-9812b486b5237933559c1bea8a11eff2b0d2af49.tar.gz
Refs #32668 -- Simplified start_at/start_after logic in runtests.py's setup().
Diffstat (limited to 'tests/runtests.py')
-rwxr-xr-xtests/runtests.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/runtests.py b/tests/runtests.py
index 812cb929ed..375b1c6d45 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -223,16 +223,16 @@ def setup(verbosity, start_at, start_after, test_labels=None):
# Exact or ancestor match.
return module_name == label or module_name.startswith(label + '.')
- found_start = not (start_at or start_after)
+ start_label = start_at or start_after
installed_app_names = set(get_installed())
for test_module in get_test_modules():
- if not found_start:
- if start_at and _module_match_label(test_module, start_at):
- found_start = True
- elif start_after and _module_match_label(test_module, start_after):
- found_start = True
+ if start_label:
+ if not _module_match_label(test_module, start_label):
continue
- else:
+ start_label = ''
+ if not start_at:
+ assert start_after
+ # Skip the current one before starting.
continue
# if the module (or an ancestor) was named on the command line, or
# no modules were named (i.e., run all), import