diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-12 18:43:49 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-12 18:46:13 +0100 |
commit | d9f3f322c5f17a4c3d3ac000462a7bbd0a407711 (patch) | |
tree | 76874409750777ae57e9065950952cbb02735281 /tests/unittest.py | |
parent | Define a (class) decorator for easily setting a DEBUG logging level on a Test... (diff) | |
download | synapse-d9f3f322c5f17a4c3d3ac000462a7bbd0a407711.tar.xz |
Additionally look first for a 'loglevel' attribute on the running test method, before the TestCase
Diffstat (limited to 'tests/unittest.py')
-rw-r--r-- | tests/unittest.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/unittest.py b/tests/unittest.py index c66a3b8407..8ae724c786 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -27,10 +27,14 @@ logging.getLogger().setLevel(NEVER) class TestCase(unittest.TestCase): - def __init__(self, *args, **kwargs): - super(TestCase, self).__init__(*args, **kwargs) + def __init__(self, methodName, *args, **kwargs): + super(TestCase, self).__init__(methodName, *args, **kwargs) - level = getattr(self, "loglevel", NEVER) + method = getattr(self, methodName) + + level = getattr(method, "loglevel", + getattr(self, "loglevel", + NEVER)) orig_setUp = self.setUp |