[Zope3-checkins] SVN: zope.testing/branches/colorized-output/src/zope/testing/testrunner.py Colorize the totals as well.

Marius Gedminas marius at pov.lt
Fri Jul 13 11:29:14 EDT 2007


Log message for revision 77869:
  Colorize the totals as well.
  
  

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

-=-
Modified: zope.testing/branches/colorized-output/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/branches/colorized-output/src/zope/testing/testrunner.py	2007-07-13 15:21:47 UTC (rev 77868)
+++ zope.testing/branches/colorized-output/src/zope/testing/testrunner.py	2007-07-13 15:29:14 UTC (rev 77869)
@@ -620,9 +620,11 @@
             return self.color('ok-number')
 
     def info(self, message):
+        """Print an informative message."""
         print self.colorize('info', message)
 
     def error(self, message):
+        """Report an error."""
         print self.colorize('error', message)
 
     def error_with_banner(self, message):
@@ -647,7 +649,19 @@
             self.color('info'), ' seconds.',
             self.color('normal'), '\n'])
 
+    def totals(self, n_tests, n_failures, n_errors):
+        """Report totals (number of tests, failures, and errors)."""
+        sys.stdout.writelines([
+            self.color('info'), 'Total: ',
+            self.color('number'), str(n_tests),
+            self.color('info'), ' tests with ',
+            self.error_count_color(n_failures), str(n_failures),
+            self.color('info'), ' failures and ',
+            self.error_count_color(n_errors), str(n_errors),
+            self.color('info'), ' errors',
+            self.color('normal'), '\n'])
 
+
 def run(defaults=None, args=None):
     if args is None:
         args = sys.argv



More information about the Zope3-Checkins mailing list