Refs #32668 -- Refactored away module_found_in_labels in runtests.py's setup().
This commit is contained in:
parent
90f41c2d91
commit
ffc0d57a04
|
@ -231,16 +231,17 @@ def setup(verbosity, start_at, start_after, test_labels=None):
|
||||||
# if the module (or an ancestor) was named on the command line, or
|
# if the module (or an ancestor) was named on the command line, or
|
||||||
# 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(
|
if test_labels and not any(
|
||||||
_module_match_label(module_label, label) for label in test_labels_set
|
_module_match_label(test_module, label) for label in test_labels_set
|
||||||
)
|
):
|
||||||
|
continue
|
||||||
|
|
||||||
if module_name in CONTRIB_TESTS_TO_APPS and module_found_in_labels:
|
if module_name in CONTRIB_TESTS_TO_APPS:
|
||||||
for contrib_app in CONTRIB_TESTS_TO_APPS[module_name]:
|
for contrib_app in CONTRIB_TESTS_TO_APPS[module_name]:
|
||||||
if contrib_app not in settings.INSTALLED_APPS:
|
if contrib_app not in settings.INSTALLED_APPS:
|
||||||
settings.INSTALLED_APPS.append(contrib_app)
|
settings.INSTALLED_APPS.append(contrib_app)
|
||||||
|
|
||||||
if module_found_in_labels and module_label not in installed_app_names:
|
if module_label not in installed_app_names:
|
||||||
if verbosity >= 2:
|
if verbosity >= 2:
|
||||||
print("Importing application %s" % module_name)
|
print("Importing application %s" % module_name)
|
||||||
settings.INSTALLED_APPS.append(module_label)
|
settings.INSTALLED_APPS.append(module_label)
|
||||||
|
|
Loading…
Reference in New Issue