diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-12-14 14:19:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-14 14:19:47 -0500 |
commit | 1619802228033455ff6e5863c52556996b38e8c6 (patch) | |
tree | 221d82bcf5ef163c833a5c602048beed7d3d1287 /tests/logging | |
parent | Preparatory refactoring of the OidcHandlerTestCase (#8911) (diff) | |
download | synapse-1619802228033455ff6e5863c52556996b38e8c6.tar.xz |
Various clean-ups to the logging context code (#8935)
Diffstat (limited to 'tests/logging')
-rw-r--r-- | tests/logging/test_terse_json.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/logging/test_terse_json.py b/tests/logging/test_terse_json.py index f6e7e5fdaa..48a74e2eee 100644 --- a/tests/logging/test_terse_json.py +++ b/tests/logging/test_terse_json.py @@ -117,11 +117,10 @@ class TerseJsonTestCase(LoggerCleanupMixin, TestCase): """ handler = logging.StreamHandler(self.output) handler.setFormatter(JsonFormatter()) - handler.addFilter(LoggingContextFilter(request="")) + handler.addFilter(LoggingContextFilter()) logger = self.get_logger(handler) - with LoggingContext() as context_one: - context_one.request = "test" + with LoggingContext(request="test"): logger.info("Hello there, %s!", "wally") log = self.get_log_line() @@ -132,9 +131,7 @@ class TerseJsonTestCase(LoggerCleanupMixin, TestCase): "level", "namespace", "request", - "scope", ] self.assertCountEqual(log.keys(), expected_log_keys) self.assertEqual(log["log"], "Hello there, wally!") self.assertEqual(log["request"], "test") - self.assertIsNone(log["scope"]) |