[Zope3-checkins] SVN: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py refactored reporting flags

Christian Theune ct at gocept.com
Sat May 3 14:06:09 EDT 2008


Log message for revision 86261:
  refactored reporting flags
  

Changed:
  U   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py

-=-
Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py	2008-05-03 18:03:29 UTC (rev 86260)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py	2008-05-03 18:06:08 UTC (rev 86261)
@@ -84,8 +84,6 @@
             return True
 
         self.setup_features()
-        # Control reporting flags during run
-        old_reporting_flags = doctest.set_unittest_reportflags(0)
 
         options = self.options
         output = options.output
@@ -154,7 +152,7 @@
             r = tracer.results()
             r.write_results(summary=True, coverdir=coverdir)
 
-        doctest.set_unittest_reportflags(old_reporting_flags)
+        doctest.set_unittest_reportflags(self.old_reporting_flags)
 
         if failed and options.exitwithstatus:
             sys.exit(1)
@@ -194,7 +192,10 @@
         # It's not at all clear that the test runner should be doing this.
         configure_logging()
 
+        # Control reporting flags during run
+        self.old_reporting_flags = doctest.set_unittest_reportflags(0)
 
+
     def find_tests(self):
         pass
 
@@ -246,7 +247,7 @@
                 new_flags |= getattr(gc, op)
             gc.set_debug(new_flags)
 
-        old_reporting_flags = doctest.set_unittest_reportflags(0)
+        self.old_reporting_flags = doctest.set_unittest_reportflags(0)
         reporting_flags = 0
         if options.ndiff:
             reporting_flags = doctest.REPORT_NDIFF
@@ -266,7 +267,7 @@
         if reporting_flags:
             doctest.set_unittest_reportflags(reporting_flags)
         else:
-            doctest.set_unittest_reportflags(old_reporting_flags)
+            doctest.set_unittest_reportflags(self.old_reporting_flags)
 
 
         # Add directories to the path
@@ -366,7 +367,7 @@
 
             output.modules_with_import_problems(import_errors)
 
-        doctest.set_unittest_reportflags(old_reporting_flags)
+        doctest.set_unittest_reportflags(self.old_reporting_flags)
 
         if options.gc_option:
             gc.set_debug(old_flags)



More information about the Zope3-Checkins mailing list