mirror of https://github.com/django/django.git
Refs #28520 -- Added _module_match_label() hook to runtests.py.
This commit is contained in:
parent
59f04d6b8f
commit
ef7e0ae53b
|
@ -195,6 +195,10 @@ def setup(verbosity, test_labels, parallel):
|
|||
print('Aborting: A GIS database backend is required to run gis_tests.')
|
||||
sys.exit(1)
|
||||
|
||||
def _module_match_label(module_label, label):
|
||||
# Exact or ancestor match.
|
||||
return module_label == label or module_label.startswith(label + '.')
|
||||
|
||||
# Load all the test model apps.
|
||||
test_modules = get_test_modules()
|
||||
|
||||
|
@ -208,9 +212,7 @@ def setup(verbosity, test_labels, parallel):
|
|||
# no modules were named (i.e., run all), import
|
||||
# this module and add it to INSTALLED_APPS.
|
||||
module_found_in_labels = not test_labels or any(
|
||||
# exact match or ancestor match
|
||||
module_label == label or module_label.startswith(label + '.')
|
||||
for label in test_labels_set
|
||||
_module_match_label(module_label, label) for label in test_labels_set
|
||||
)
|
||||
|
||||
if module_name in CONTRIB_TESTS_TO_APPS and module_found_in_labels:
|
||||
|
|
Loading…
Reference in New Issue