summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/support.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-08-03 18:53:07 (GMT)
committerFred Drake <fdrake@acm.org>2004-08-03 18:53:07 (GMT)
commitedcac8f416ebe4561bbc0e91c46a3bfc5457f73c (patch)
treedf4fbed36f3dfc843a735183c440453be3eb6a05 /Lib/distutils/tests/support.py
parent1fa649f2d5d4a63105577888830276a6dc4771b5 (diff)
downloadcpython-edcac8f416ebe4561bbc0e91c46a3bfc5457f73c.zip
cpython-edcac8f416ebe4561bbc0e91c46a3bfc5457f73c.tar.gz
cpython-edcac8f416ebe4561bbc0e91c46a3bfc5457f73c.tar.bz2
make sure distutils logging is shut off in tests to avoid spurious output
Diffstat (limited to 'Lib/distutils/tests/support.py')
-rw-r--r--Lib/distutils/tests/support.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py
index cef985d..475ceee 100644
--- a/Lib/distutils/tests/support.py
+++ b/Lib/distutils/tests/support.py
@@ -3,6 +3,19 @@
import shutil
import tempfile
+from distutils import log
+
+
+class LoggingSilencer(object):
+
+ def setUp(self):
+ super(LoggingSilencer, self).setUp()
+ self.threshold = log.set_threshold(log.FATAL)
+
+ def tearDown(self):
+ log.set_threshold(self.threshold)
+ super(LoggingSilencer, self).tearDown()
+
class TempdirManager(object):
"""Mix-in class that handles temporary directories for test cases.