summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-01-05 01:09:25 +0100
committerJelmer Vernooij <jelmer@samba.org>2011-01-05 01:58:44 +0100
commite80b322077d132c8973e85d25ef40c956e8f5b54 (patch)
tree97287562d7975991ea965a5dc0cf24ebe64b8bde /source4
parent733bc1c1ca31df2b61d86f5ee8783ee9c3867faa (diff)
downloadsamba-e80b322077d132c8973e85d25ef40c956e8f5b54.tar.gz
samba-e80b322077d132c8973e85d25ef40c956e8f5b54.tar.bz2
samba-e80b322077d132c8973e85d25ef40c956e8f5b54.zip
s4-python: Allow setting TEST_DEBUG_LEVEL to override debug level for tests.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Wed Jan 5 01:58:44 CET 2011 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/tests/__init__.py10
1 files changed, 10 insertions, 0 deletions
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()