diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-12 18:38:11 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-12 18:46:13 +0100 |
commit | 33c4dd4c2ddcd81854855e84a838db9603bbe338 (patch) | |
tree | d197026161b36eaeaf241cd4a5931b6777fceb37 /tests | |
parent | Allow a TestCase to set a 'loglevel' attribute, which overrides the logging l... (diff) | |
download | synapse-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.py | 5 |
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 |