summary refs log tree commit diff
path: root/tests/logging/test_terse_json.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-12-14 14:19:47 -0500
committerGitHub <noreply@github.com>2020-12-14 14:19:47 -0500
commit1619802228033455ff6e5863c52556996b38e8c6 (patch)
tree221d82bcf5ef163c833a5c602048beed7d3d1287 /tests/logging/test_terse_json.py
parentPreparatory refactoring of the OidcHandlerTestCase (#8911) (diff)
downloadsynapse-1619802228033455ff6e5863c52556996b38e8c6.tar.xz
Various clean-ups to the logging context code (#8935)
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"])