Additionally look first for a 'loglevel' attribute on the running test method, before the TestCase

This commit is contained in:
Paul "LeoNerd" Evans 2014-09-12 18:43:49 +01:00
parent 33c4dd4c2d
commit d9f3f322c5

View file

@ -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