[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt Make the tests not print anything to stderr.

Marius Gedminas marius at pov.lt
Thu Mar 25 11:37:09 EDT 2010


Log message for revision 110177:
  Make the tests not print anything to stderr.
  
  The regression test, introduced in r88047, still works, which I checked by
  temporarily reintroducing the raise SubprocessError and seeing it fail.
  
  (Incidentally, SubprocessError is never raised anywhere in the current
  codebase.  Instead, output.error_with_banner is called directly.)
  
  

Changed:
  U   zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt	2010-03-25 14:05:09 UTC (rev 110176)
+++ zope.testing/trunk/src/zope/testing/testrunner/testrunner-layers-ntd.txt	2010-03-25 15:37:09 UTC (rev 110177)
@@ -244,6 +244,10 @@
 stderrtest does), the output is ignored (but it doesn't cause a SubprocessError
 like it once did).
 
+    >>> from cStringIO import StringIO
+    >>> real_stderr = sys.stderr
+    >>> sys.stderr = StringIO()
+
     >>> sys.argv = [testrunner_script, '-s', 'sample2', '--tests-pattern',
     ...     '(sampletests_ntd$|stderrtest)']
     >>> testrunner.run_internal(defaults)
@@ -258,3 +262,9 @@
       Tear down sample2.stderrtest.Layer in 0.000 seconds.
     Total: 2 tests, 0 failures, 0 errors in 0.197 seconds.
     False
+
+    >>> print sys.stderr.getvalue()
+    A message on stderr.  Please ignore (expected in test output).
+
+    >>> sys.stderr = real_stderr
+



More information about the Zope3-Checkins mailing list