1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #32668 -- Passed setup()'s return value to run_tests() instead of get_installed().

This commit is contained in:
Chris Jerdonek 2021-06-03 18:17:44 -07:00 committed by Mariusz Felisiak
parent b3083d5bd2
commit e96e93618c

View File

@ -286,7 +286,8 @@ def setup(verbosity, start_at, start_after, test_labels=None):
# Django's own test suite is running.
os.environ['RUNNING_DJANGOS_TEST_SUITE'] = 'true'
return state
test_labels = test_labels or test_modules
return test_labels, state
def teardown(state):
@ -338,7 +339,7 @@ def django_tests(verbosity, interactive, failfast, keepdb, reverse,
msg += " with up to %d processes" % max_parallel
print(msg)
state = setup(verbosity, start_at, start_after, test_labels)
test_labels, 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'
@ -358,7 +359,7 @@ def django_tests(verbosity, interactive, failfast, keepdb, reverse,
buffer=buffer,
timing=timing,
)
failures = test_runner.run_tests(test_labels or get_installed())
failures = test_runner.run_tests(test_labels)
teardown(state)
return failures