From e80b322077d132c8973e85d25ef40c956e8f5b54 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 5 Jan 2011 01:09:25 +0100 Subject: s4-python: Allow setting TEST_DEBUG_LEVEL to override debug level for tests. Autobuild-User: Jelmer Vernooij Autobuild-Date: Wed Jan 5 01:58:44 CET 2011 on sn-devel-104 --- source4/scripting/python/samba/tests/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/scripting') diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py index 10826ab483..d0362efb4a 100644 --- a/source4/scripting/python/samba/tests/__init__.py +++ b/source4/scripting/python/samba/tests/__init__.py @@ -36,6 +36,16 @@ from testtools.testcase import ( class TestCase(TesttoolsTestCase): + """A Samba test case.""" + + def setUp(self): + super(TestCase, self).setUp() + test_debug_level = os.getenv("TEST_DEBUG_LEVEL") + if test_debug_level is not None: + test_debug_level = int(test_debug_level) + self._old_debug_level = samba.get_debug_level() + samba.set_debug_level(test_debug_level) + self.addCleanup(samba.set_debug_level, test_debug_level) def get_loadparm(self): return env_loadparm() -- cgit