[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner. add reporting of uncovered lines

Benji York benji at zope.com
Mon Aug 15 11:07:30 EDT 2005


Log message for revision 37938:
  add reporting of uncovered lines
  
  includes minor hack: the trace module complains about not being able to open
  the wierd module paths for test-generated modules, so I redirected stderr for
  that test to stdout and let the ellipsis eat the messages.
  

Changed:
  U   zope.testing/trunk/src/zope/testing/testrunner.py
  U   zope.testing/trunk/src/zope/testing/testrunner.txt

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.py	2005-08-15 14:34:42 UTC (rev 37937)
+++ zope.testing/trunk/src/zope/testing/testrunner.py	2005-08-15 15:07:00 UTC (rev 37938)
@@ -247,8 +247,7 @@
                               locals=vars())
 
                 r = tracer.results()
-                r.write_results(show_missing=False, summary=True, 
-                                coverdir=coverdir)
+                r.write_results(summary=True, coverdir=coverdir)
             else:
                 tests(result)
         t = time.time() - t

Modified: zope.testing/trunk/src/zope/testing/testrunner.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.txt	2005-08-15 14:34:42 UTC (rev 37937)
+++ zope.testing/trunk/src/zope/testing/testrunner.txt	2005-08-15 15:07:00 UTC (rev 37938)
@@ -1904,14 +1904,23 @@
 If the --coverage option is used, test coverage reports will be generated.  The
 directory name given as the parameter will be used to hold the reports.
 
+    >>> # XXX the trace module reports errors to stderr, we don't care about
+    >>> original_stderr = sys.stderr
+    >>> sys.stderr = sys.stdout
+
     >>> from zope.testing import testrunner
     >>> sys.argv = 'test --coverage=coverage_dir'.split()
+
     >>> testrunner.run(defaults)
     Running unit tests:
+    ...
     lines   cov%   module   (path)
     ...   ...%   zope.testing.testrunner   (src/zope/testing/testrunner.py)
     ...
 
+    >>> # XXX clean up stderr
+    >>> sys.stderr = original_stderr
+
 The directory specified with the --coverage option will have been created and
 will hold the coverage reports.
 



More information about the Zope3-Checkins mailing list