summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-09-12 18:38:11 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-09-12 18:46:13 +0100
commit33c4dd4c2ddcd81854855e84a838db9603bbe338 (patch)
treed197026161b36eaeaf241cd4a5931b6777fceb37 /tests
parentAllow a TestCase to set a 'loglevel' attribute, which overrides the logging l... (diff)
downloadsynapse-33c4dd4c2ddcd81854855e84a838db9603bbe338.tar.xz
Define a (class) decorator for easily setting a DEBUG logging level on a TestCase
Diffstat (limited to 'tests')
-rw-r--r--tests/unittest.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unittest.py b/tests/unittest.py
index 19be03b96a..c66a3b8407 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -49,3 +49,8 @@ class TestCase(unittest.TestCase):
             logging.getLogger().setLevel(level)
             return orig_setUp()
         self.setUp = setUp
+
+
+def DEBUG(target):
+    target.loglevel = logging.DEBUG
+    return target