1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Refs #32668 -- Made setup()'s test_labels argument optional in runtests.py.

This commit is contained in:
Chris Jerdonek 2021-04-21 04:02:58 -07:00 committed by Mariusz Felisiak
parent 62e8f369c3
commit 90f41c2d91

View File

@ -132,7 +132,9 @@ def get_installed():
return [app_config.name for app_config in apps.get_app_configs()]
def setup(verbosity, test_labels, start_at, start_after):
def setup(verbosity, start_at, start_after, test_labels=None):
if test_labels is None:
test_labels = []
# Reduce each test label to just the top-level module part.
test_labels_set = set()
for label in test_labels:
@ -309,7 +311,7 @@ def django_tests(verbosity, interactive, failfast, keepdb, reverse,
msg += " with up to %d processes" % max_parallel
print(msg)
state = setup(verbosity, test_labels, start_at, start_after)
state = setup(verbosity, start_at, start_after, test_labels)
# Run the test suite, including the extra validation tests.
if not hasattr(settings, 'TEST_RUNNER'):
settings.TEST_RUNNER = 'django.test.runner.DiscoverRunner'
@ -335,8 +337,7 @@ def django_tests(verbosity, interactive, failfast, keepdb, reverse,
def get_app_test_labels(verbosity, start_at, start_after):
test_labels = []
state = setup(verbosity, test_labels, start_at, start_after)
state = setup(verbosity, start_at, start_after)
test_labels = get_installed()
teardown(state)
return test_labels