#27019: DiscoverRunner does not restore old settings.DEBUG value in teardown -----------------------------------+-------------------- Reporter: cjerdonek | Owner: nobody Type: Bug | Status: new Component: Testing framework | Version: 1.10 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 -----------------------------------+-------------------- `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. -- Ticket URL: <https://code.djangoproject.com/ticket/27019> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.504fcb0e0ef5665c1be28930f5fb89e5%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.