[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner/ tweak the test for handling spurious output on stderr

Benji York benji at zope.com
Thu Jul 10 21:54:50 EDT 2008


Log message for revision 88220:
  tweak the test for handling spurious output on stderr
  

Changed:
  U   zope.testing/trunk/src/zope/testing/testrunner/runner.py
  U   zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py
  U   zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner/runner.py	2008-07-10 22:48:13 UTC (rev 88219)
+++ zope.testing/trunk/src/zope/testing/testrunner/runner.py	2008-07-11 01:54:48 UTC (rev 88220)
@@ -410,7 +410,7 @@
             whole_suberr += line
             if not line:
                 raise SubprocessError(
-                    'No subprocess summary found', whole_suberr+suberr.read())
+                    'No subprocess summary found', repr(whole_suberr))
 
             try:
                 ran, nfail, nerr = map(int, line.strip().split())

Modified: zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py	2008-07-10 22:48:13 UTC (rev 88219)
+++ zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py	2008-07-11 01:54:48 UTC (rev 88220)
@@ -21,9 +21,7 @@
 import sys
 
 
-sys.stderr.write('A message on stderr.\n')
 
-
 class Layer:
 
     def setUp(self):
@@ -43,6 +41,9 @@
 
 
 def test_suite():
+    # Generate some text on stderr to be sure the test runner can handle it.
+    sys.stderr.write('A message on stderr.\n')
+
     suite = unittest.TestSuite()
     d = doctest.DocTestSuite()
     d.layer = Layer

Modified: zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt	2008-07-10 22:48:13 UTC (rev 88219)
+++ zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt	2008-07-11 01:54:48 UTC (rev 88220)
@@ -244,7 +244,8 @@
 stderrtest does), the output is ignored (but it doesn't cause a SubprocessError
 like it once did).
 
-    >>> sys.argv = [testrunner_script, '-s', 'sample2', '--tests-pattern', '(sampletests_ntd$|stderrtest)']
+    >>> sys.argv = [testrunner_script, '-s', 'sample2', '--tests-pattern',
+    ...     '(sampletests_ntd$|stderrtest)']
     >>> testrunner.run(defaults)
     Running sample2.sampletests_ntd.Layer tests:
       Set up sample2.sampletests_ntd.Layer in 0.000 seconds.



More information about the Zope3-Checkins mailing list