diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-12 18:45:48 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-12 18:46:13 +0100 |
commit | aeb69c0f8cc6e723316aefbc6b71c82b4ed94aad (patch) | |
tree | 410cac9157e80d0ea83d011123b6e48994dfe1e7 /tests/unittest.py | |
parent | Additionally look first for a 'loglevel' attribute on the running test method... (diff) | |
download | synapse-aeb69c0f8cc6e723316aefbc6b71c82b4ed94aad.tar.xz |
Add some docstrings
Diffstat (limited to '')
-rw-r--r-- | tests/unittest.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unittest.py b/tests/unittest.py index 8ae724c786..e437d3541a 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -27,6 +27,10 @@ logging.getLogger().setLevel(NEVER) class TestCase(unittest.TestCase): + """A subclass of twisted.trial's TestCase which looks for 'loglevel' + attributes on both itself and its individual test methods, to override the + root logger's logging level while that test (case|method) runs.""" + def __init__(self, methodName, *args, **kwargs): super(TestCase, self).__init__(methodName, *args, **kwargs) @@ -56,5 +60,7 @@ class TestCase(unittest.TestCase): def DEBUG(target): + """A decorator to set the .loglevel attribute to logging.DEBUG. + Can apply to either a TestCase or an individual test method.""" target.loglevel = logging.DEBUG return target |