summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2019-05-28 11:37:37 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-05-30 09:29:09 +0200
commitef7e0ae53bf42942c3dcf1155962b90ab3f3e6fd (patch)
treedd1f51bdc4851ccd16560df61ecd4619f3809f70
parent59f04d6b8f6c7c7a1039185bd2c5653ea91f7ff7 (diff)
Refs #28520 -- Added _module_match_label() hook to runtests.py.
-rwxr-xr-xtests/runtests.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/runtests.py b/tests/runtests.py
index e117df709b..cac4fa26e1 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -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: