﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27019	DiscoverRunner does not restore old settings.DEBUG value in teardown	Chris Jerdonek	Chris Jerdonek	"`DiscoverRunner.teardown_test_environment()` [https://github.com/django/django/blob/967aa7f6cc720b11e38b7e0cbeffc2c95c64fa05/django/test/runner.py#L529 does not] restore the pre-test value of `settings.DEBUG`, as for example `test.utils.teardown_test_environment()` does for [https://github.com/django/django/blob/967aa7f6cc720b11e38b7e0cbeffc2c95c64fa05/django/test/utils.py#L122 the values it knows about].

Since `test.utils`'s `setup_test_environment()` and `teardown_test_environment()` already have a pattern of storing and restoring environment values, I propose that this be addressed by adding a `debug` argument to `test.utils.setup_test_environment()` that `DiscoverRunner.setup_test_environment()` can then use.

Alternatively, `test.utils.setup_test_environment()` could take responsibility for setting `DEBUG` to false.
"	Cleanup/optimization	closed	Testing framework	1.10	Normal	fixed			Accepted	1	0	0	0	0	0
