[Zope3-checkins]
SVN: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/
merge bug fix from trunk:
Benji York
benji at zope.com
Sat Jul 5 20:20:21 EDT 2008
Log message for revision 88050:
merge bug fix from trunk:
svn merge -c88047 svn+ssh://svn.zope.org/repos/main/zope.testing/trunk .
Changed:
U zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py
A zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py
U zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/testrunner-layers-ntd.txt
-=-
Modified: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py 2008-07-06 00:11:03 UTC (rev 88049)
+++ zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/runner.py 2008-07-06 00:20:20 UTC (rev 88050)
@@ -419,7 +419,7 @@
whole_suberr += line
if not line:
raise SubprocessError(
- 'No subprocess summary found', whole_suberr)
+ 'No subprocess summary found', whole_suberr+suberr.read())
try:
result.num_ran, nfail, nerr = map(int, line.strip().split())
Copied: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py (from rev 88047, zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py)
===================================================================
--- zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py (rev 0)
+++ zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/testrunner-ex/sample2/stderrtest.py 2008-07-06 00:20:20 UTC (rev 88050)
@@ -0,0 +1,54 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Sample tests with a layer that produces output on stderr
+
+$Id$
+"""
+
+import unittest
+from zope.testing import doctest
+import sys
+
+
+sys.stderr.write('A message on stderr.\n')
+
+
+class Layer:
+
+ def setUp(self):
+ pass
+ setUp = classmethod(setUp)
+
+ def tearDown(self):
+ pass
+ tearDown = classmethod(tearDown)
+
+
+def test_something():
+ """
+ >>> 1 + 1
+ 2
+ """
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ d = doctest.DocTestSuite()
+ d.layer = Layer
+ suite.addTest(d)
+ return suite
+
+
+if __name__ == '__main__':
+ unittest.main()
Modified: zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/testrunner-layers-ntd.txt
===================================================================
--- zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/testrunner-layers-ntd.txt 2008-07-06 00:11:03 UTC (rev 88049)
+++ zope.testing/branches/benji-parallelize-subprocesses/src/zope/testing/testrunner/testrunner-layers-ntd.txt 2008-07-06 00:20:20 UTC (rev 88050)
@@ -238,3 +238,22 @@
If you want to use pdb from a test in a layer that is run as a
subprocess, then rerun the test runner selecting *just* that layer so
that it's not run as a subprocess.
+
+
+If a test is run in a subprocess and it generates output on stderr (as
+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)']
+ >>> testrunner.run(defaults)
+ Running sample2.sampletests_ntd.Layer tests:
+ Set up sample2.sampletests_ntd.Layer in 0.000 seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.000 seconds.
+ Running sample2.stderrtest.Layer tests:
+ Tear down sample2.sampletests_ntd.Layer ... not supported
+ Running in a subprocess.
+ Set up sample2.stderrtest.Layer in 0.000 seconds.
+ Ran 1 tests with 0 failures and 0 errors in 0.002 seconds.
+ Tear down sample2.stderrtest.Layer in 0.000 seconds.
+ Total: 2 tests, 0 failures, 0 errors in 0.197 seconds.
+ False
More information about the Zope3-Checkins
mailing list