[Checkins] SVN: z3c.checkversions/trunk/z3c/checkversions/test.py Explicitly set the distutils log threshold in the test suite.

Marius Gedminas cvs-admin at zope.org
Mon Jun 11 09:10:14 UTC 2012


Log message for revision 126704:
  Explicitly set the distutils log threshold in the test suite.
  
  This makes it possible to run the tests using zope.testrunner.  (I've no
  idea why or how it muchs with the distutils log threshold, and no plans to
  investigate.)

Changed:
  U   z3c.checkversions/trunk/z3c/checkversions/test.py

-=-
Modified: z3c.checkversions/trunk/z3c/checkversions/test.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/test.py	2012-06-11 09:10:06 UTC (rev 126703)
+++ z3c.checkversions/trunk/z3c/checkversions/test.py	2012-06-11 09:10:11 UTC (rev 126704)
@@ -13,13 +13,17 @@
 ##############################################################################
 
 from doctest import DocFileSuite, ELLIPSIS, NORMALIZE_WHITESPACE
-import unittest
+import distutils.log
 
+def setUp(test):
+    test._old_log_level = distutils.log.set_threshold(distutils.log.INFO)
+
+def tearDown(test):
+    distutils.log.set_threshold(test._old_log_level)
+
 def test():
     optionflags = ELLIPSIS|NORMALIZE_WHITESPACE
-    suite = unittest.TestSuite()
-    suite.addTest(DocFileSuite('README.txt', optionflags=optionflags))
-    suite.addTest(DocFileSuite('buildout.txt', optionflags=optionflags))
-    suite.addTest(DocFileSuite('installed.txt', optionflags=optionflags))
-
+    suite = DocFileSuite('README.txt', 'buildout.txt', 'installed.txt',
+                         setUp=setUp, tearDown=tearDown,
+                         optionflags=optionflags)
     return suite



More information about the checkins mailing list