summaryrefslogtreecommitdiff
path: root/tests/logging_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-06-04 12:53:11 +0200
committerGitHub <noreply@github.com>2021-06-04 12:53:11 +0200
commit213850b4b9641bdcb714172999725ec9aa9c9e84 (patch)
treea62f1a50c2b78b2c944b7c7d9167efadf5910d4f /tests/logging_tests
parent2e4711c611896ae6490d3fa3f8d0c506f2ff3673 (diff)
downloaddjango-213850b4b9641bdcb714172999725ec9aa9c9e84.tar.gz
Refs #32355 -- Used addClassCleanup() in tests.
Inspired by Adam Johnson talk on DjangoCon Europe 2021.
Diffstat (limited to 'tests/logging_tests')
-rw-r--r--tests/logging_tests/tests.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/tests/logging_tests/tests.py b/tests/logging_tests/tests.py
index e565905795..a06cda9efa 100644
--- a/tests/logging_tests/tests.py
+++ b/tests/logging_tests/tests.py
@@ -53,13 +53,8 @@ class SetupDefaultLoggingMixin:
@classmethod
def setUpClass(cls):
super().setUpClass()
- cls._logging = settings.LOGGING
logging.config.dictConfig(DEFAULT_LOGGING)
-
- @classmethod
- def tearDownClass(cls):
- super().tearDownClass()
- logging.config.dictConfig(cls._logging)
+ cls.addClassCleanup(logging.config.dictConfig, settings.LOGGING)
class DefaultLoggingTests(SetupDefaultLoggingMixin, LoggingCaptureMixin, SimpleTestCase):