[Checkins] SVN: zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py Move garbage reporting into OutputFormatter.

Marius Gedminas marius at pov.lt
Fri Jul 13 07:23:38 EDT 2007


Log message for revision 77851:
  Move garbage reporting into OutputFormatter.
  
  

Changed:
  U   zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py

-=-
Modified: zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py	2007-07-13 11:14:14 UTC (rev 77850)
+++ zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py	2007-07-13 11:23:38 UTC (rev 77851)
@@ -389,6 +389,13 @@
             print "Tests generated new (%d) garbage:" % len(garbage)
             print garbage
 
+    def test_garbage(self, test, garbage):
+        """Report garbage generated by a single test."""
+        if garbage:
+            print "The following test left garbage:"
+            print test
+            print garbage
+
     def start_set_up(self, layer_name):
         """Report that we're setting up a layer.
 
@@ -1118,11 +1125,8 @@
         self.testTearDown()
         self.options.output.stop_test(test)
 
-        # TODO NOW PERHAPS: figure out how to move this to OutputFormatter
         if gc.garbage:
-            print "The following test left garbage:"
-            print test
-            print gc.garbage
+            self.options.output.test_garbage(test, gc.garbage)
             # TODO: Perhaps eat the garbage here, so that the garbage isn't
             #       printed for every subsequent test.
 



More information about the Checkins mailing list