mirror of
https://github.com/django/django.git
synced 2025-02-08 16:35:17 +00:00
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.')
|
print('Aborting: A GIS database backend is required to run gis_tests.')
|
||||||
sys.exit(1)
|
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.
|
# Load all the test model apps.
|
||||||
test_modules = get_test_modules()
|
test_modules = get_test_modules()
|
||||||
|
|
||||||
@ -208,9 +212,7 @@ def setup(verbosity, test_labels, parallel):
|
|||||||
# no modules were named (i.e., run all), import
|
# no modules were named (i.e., run all), import
|
||||||
# this module and add it to INSTALLED_APPS.
|
# this module and add it to INSTALLED_APPS.
|
||||||
module_found_in_labels = not test_labels or any(
|
module_found_in_labels = not test_labels or any(
|
||||||
# exact match or ancestor match
|
_module_match_label(module_label, label) for label in test_labels_set
|
||||||
module_label == label or module_label.startswith(label + '.')
|
|
||||||
for label in test_labels_set
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if module_name in CONTRIB_TESTS_TO_APPS and module_found_in_labels:
|
if module_name in CONTRIB_TESTS_TO_APPS and module_found_in_labels:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user