summary refs log tree commit diff
path: root/tests/logging/test_terse_json.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-16 15:06:19 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-16 15:06:19 +0100
commit394e6d2c723cef2ad5a63c4db5f0f68dea26e025 (patch)
treea3f979a8fe50852fad93e8232674d5f27a7f34ce /tests/logging/test_terse_json.py
parentlint (diff)
parentPreparatory refactoring of the SamlHandlerTestCase (#8938) (diff)
downloadsynapse-394e6d2c723cef2ad5a63c4db5f0f68dea26e025.tar.xz
Merge commit '01333681b' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'tests/logging/test_terse_json.py')
-rw-r--r--tests/logging/test_terse_json.py7
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"])