[Zope3-checkins] SVN: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/ Moved out total reporting to the filter feature.

Christian Theune ct at gocept.com
Sun May 4 12:54:31 EDT 2008


Log message for revision 86408:
  Moved out total reporting to the filter feature.
  

Changed:
  U   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/filter.py
  U   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py
  U   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-coverage.txt
  U   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-edge-cases.txt
  U   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-errors.txt
  U   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-profiling.txt

-=-
Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/filter.py
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/filter.py	2008-05-04 16:49:42 UTC (rev 86407)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/filter.py	2008-05-04 16:54:31 UTC (rev 86408)
@@ -54,3 +54,16 @@
             else:
                 msg = "Running tests at level %d" % self.runner.options.at_level
             self.runner.options.output.info(msg)
+
+    def report(self):
+        if not self.runner.do_run_tests:
+            return
+        if self.runner.options.resume_layer:
+            return
+        if self.runner.options.verbose:
+            self.runner.options.output.tests_with_errors(self.runner.errors)
+            self.runner.options.output.tests_with_failures(self.runner.failures)
+
+        if self.runner.nlayers != 1:
+            self.runner.options.output.totals(self.runner.ran, len(self.runner.failures),
+                                       len(self.runner.errors), self.runner.total_time)

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-04 16:49:42 UTC (rev 86407)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py	2008-05-04 16:54:31 UTC (rev 86408)
@@ -150,8 +150,6 @@
                 feature.global_teardown()
 
         if self.show_report:
-            if self.do_run_tests:
-                self.report()
             for feature in self.features:
                 feature.report()
 
@@ -257,17 +255,7 @@
 
         self.failed = bool(self.import_errors or self.failures or self.errors)
 
-    def report(self):
-        if not self.options.resume_layer:
-            if self.options.verbose:
-                self.options.output.tests_with_errors(self.errors)
-                self.options.output.tests_with_failures(self.failures)
 
-            if self.nlayers != 1:
-                self.options.output.totals(self.ran, len(self.failures),
-                                           len(self.errors), self.total_time)
-
-
 def run_tests(options, tests, name, failures, errors):
     repeat = options.repeat or 1
     repeat_range = iter(range(repeat))

Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-coverage.txt
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-coverage.txt	2008-05-04 16:49:42 UTC (rev 86407)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-coverage.txt	2008-05-04 16:54:31 UTC (rev 86408)
@@ -49,7 +49,6 @@
       Tear down samplelayers.Layer122 in 0.000 seconds.
       Tear down samplelayers.Layer12 in 0.000 seconds.
       Tear down samplelayers.Layer1 in 0.000 seconds.
-    Total: 405 tests, 0 failures, 0 errors in N.NNN seconds.
     lines   cov%   module   (path)
     ...
        52    92%   sample1.sampletests.test1   (testrunner-ex/sample1/sampletests/test1.py)
@@ -60,6 +59,7 @@
        78    94%   sample1.sampletests.test121   (testrunner-ex/sample1/sampletests/test121.py)
        78    94%   sample1.sampletests.test122   (testrunner-ex/sample1/sampletests/test122.py)
     ...
+    Total: 405 tests, 0 failures, 0 errors in N.NNN seconds.
     False
 
 The directory specified with the --coverage option will have been created and

Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-edge-cases.txt
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-edge-cases.txt	2008-05-04 16:49:42 UTC (rev 86407)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-edge-cases.txt	2008-05-04 16:54:31 UTC (rev 86408)
@@ -429,10 +429,10 @@
     TypeError: Invalid test_suite, None, in sample1.sampletests_none_suite
     <BLANKLINE>
     <BLANKLINE>
-    Total: 0 tests, 0 failures, 0 errors in N.NNN seconds.
     <BLANKLINE>
     Test-modules with import problems:
       sample1.sampletests_none_suite
+    Total: 0 tests, 0 failures, 0 errors in N.NNN seconds.
     True
 
 
@@ -447,10 +447,10 @@
     TypeError: ...
     <BLANKLINE>
     <BLANKLINE>
-    Total: 0 tests, 0 failures, 0 errors in N.NNN seconds.
     <BLANKLINE>
     Test-modules with import problems:
       sample1.sampletests_none_test
+    Total: 0 tests, 0 failures, 0 errors in N.NNN seconds.
     True
 
 You must use --repeat with --report-refcounts

Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-errors.txt
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-errors.txt	2008-05-04 16:49:42 UTC (rev 86407)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-errors.txt	2008-05-04 16:54:31 UTC (rev 86408)
@@ -765,13 +765,13 @@
       Tear down samplelayers.Layer122 in 0.000 seconds.
       Tear down samplelayers.Layer12 in 0.000 seconds.
       Tear down samplelayers.Layer1 in 0.000 seconds.
-    Total: 213 tests, 0 failures, 0 errors in N.NNN seconds.
     <BLANKLINE>
     Test-modules with import problems:
       sample2.sampletests_i
       sample2.sample21.sampletests_i
       sample2.sample22.sampletests_i
       sample2.sample23.sampletests_i
+    Total: 213 tests, 0 failures, 0 errors in N.NNN seconds.
     True
 
 

Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-profiling.txt
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-profiling.txt	2008-05-04 16:49:42 UTC (rev 86407)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/testrunner-profiling.txt	2008-05-04 16:54:31 UTC (rev 86408)
@@ -25,9 +25,10 @@
     ...
     Running samplelayers.Layer11 tests:
     ...
+       ncalls  tottime  percall  cumtime  percall filename:lineno(function)
+    ...
     Total: ... tests, 0 failures, 0 errors in ... seconds.
-    ...
-       ncalls  tottime  percall  cumtime  percall filename:lineno(function)...
+    False
 
 Profiling also works across layers.
 



More information about the Zope3-Checkins mailing list