From d9f3f322c5f17a4c3d3ac000462a7bbd0a407711 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Fri, 12 Sep 2014 18:43:49 +0100 Subject: [PATCH] Additionally look first for a 'loglevel' attribute on the running test method, before the TestCase --- tests/unittest.py | 10 +++++++--- 1 file 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