[Zope3-checkins] SVN: zope.testing/branches/flakes-and-feathers/ - Merge from flakes-and-feathers
Sidnei da Silva
sidnei.da.silva at gmail.com
Wed Oct 7 12:23:28 EDT 2009
Log message for revision 104869:
- Merge from flakes-and-feathers
Changed:
U zope.testing/branches/flakes-and-feathers/CHANGES.txt
U zope.testing/branches/flakes-and-feathers/src/zope/testing/doctest.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/doctestunit.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/doctest.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/filter.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/garbagecollection.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/listing.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/logsupport.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/process.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/runner.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/selftest.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/tb_format.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-errors.txt
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gc0.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gc1.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gcset.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gcstats.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/leak.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/pledge.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample21/sampletests_i.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample22/sampletests_i.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample23/sampletests_i.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_f.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex-pp-products/more/sampletests.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex-pp-products/sampletests.py
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-gc.txt
U zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-layers-buff.txt
U zope.testing/branches/flakes-and-feathers/src/zope/testing/tests.py
-=-
Modified: zope.testing/branches/flakes-and-feathers/CHANGES.txt
===================================================================
--- zope.testing/branches/flakes-and-feathers/CHANGES.txt 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/CHANGES.txt 2009-10-07 16:23:28 UTC (rev 104869)
@@ -4,7 +4,10 @@
3.8.4 (unreleased)
==================
+- Fixed missing imports and undefined variables reported by pyflakes,
+ adding tests to exercise the blind spots.
+- Cleaned up unused imports reported by pyflakes.
3.8.3 (2009-09-21)
==================
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/doctest.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/doctest.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/doctest.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -95,7 +95,7 @@
import __future__
-import sys, traceback, inspect, linecache, os, re, types
+import sys, traceback, inspect, linecache, os, re
import unittest, difflib, pdb, tempfile
import warnings
from StringIO import StringIO
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/doctestunit.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/doctestunit.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/doctestunit.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -19,9 +19,6 @@
$Id$
"""
-from doctest import DocFileSuite, DocTestSuite
-from doctest import debug_src, debug
-
def pprint():
from pprint import PrettyPrinter
def pprint(ob, **opts):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/doctest.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/doctest.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/doctest.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -16,6 +16,7 @@
$Id: __init__.py 86232 2008-05-03 15:09:33Z ctheune $
"""
+import sys
from zope.testing import doctest
import zope.testing.testrunner.feature
@@ -26,6 +27,7 @@
def global_setup(self):
options = self.runner.options
+ output = options.output
self.old_reporting_flags = doctest.set_unittest_reportflags(0)
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/filter.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/filter.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/filter.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -16,7 +16,6 @@
$Id: __init__.py 86218 2008-05-03 14:17:26Z ctheune $
"""
-import time
import zope.testing.testrunner.feature
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/garbagecollection.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/garbagecollection.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/garbagecollection.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -17,7 +17,7 @@
"""
import gc
-import time
+import sys
import zope.testing.testrunner.feature
@@ -32,7 +32,7 @@
return
if len(self.threshold) > 3:
- output.error("Too many --gc options")
+ self.runner.options.output.error("Too many --gc options")
sys.exit(1)
def global_setup(self):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/listing.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/listing.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/listing.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -16,7 +16,6 @@
$Id: __init__.py 86218 2008-05-03 14:17:26Z ctheune $
"""
-import time
import zope.testing.testrunner.feature
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/logsupport.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/logsupport.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/logsupport.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -25,7 +25,6 @@
import logging.config
import os.path
-from zope.testing import doctest
import zope.testing.testrunner.feature
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/process.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/process.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/process.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -17,7 +17,6 @@
"""
import sys
-import time
import zope.testing.testrunner.feature
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/runner.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/runner.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -384,6 +384,8 @@
def spawn_layer_in_subprocess(result, script_parts, options, features,
layer_name, layer, failures, errors,
resume_number):
+ output = options.output
+
try:
# BBB
if script_parts is None:
@@ -449,9 +451,7 @@
else:
break
else:
- output = options.output
- output.error_with_banner("Could not communicate with subprocess:\n"
- "\n" + suberr)
+ output.error_with_banner("Could not communicate with subprocess")
while nfail > 0:
nfail -= 1
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/selftest.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/selftest.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/selftest.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -19,7 +19,6 @@
"""
import pdb
-from zope.testing import doctest
import zope.testing.testrunner.feature
real_pdb_set_trace = pdb.set_trace
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/tb_format.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/tb_format.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/tb_format.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -16,8 +16,6 @@
$Id: __init__.py 68482 2006-06-04 14:58:55Z jim $
"""
-import StringIO
-import os
import sys
import traceback
import zope.exceptions.exceptionformatter
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-errors.txt
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-errors.txt 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-errors.txt 2009-10-07 16:23:28 UTC (rev 104869)
@@ -686,7 +686,27 @@
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
+Specifying more than one diff option at once causes an error:
+ >>> sys.argv = 'test --tests-pattern ^pledge$ --cdiff --udiff'.split()
+ >>> _ = testrunner.run_internal(defaults)
+ Traceback (most recent call last):
+ ...
+ SystemExit: 1
+
+ >>> sys.argv = 'test --tests-pattern ^pledge$ --cdiff --ndiff'.split()
+ >>> _ = testrunner.run_internal(defaults)
+ Traceback (most recent call last):
+ ...
+ SystemExit: 1
+
+ >>> sys.argv = 'test --tests-pattern ^pledge$ --udiff --ndiff'.split()
+ >>> _ = testrunner.run_internal(defaults)
+ Traceback (most recent call last):
+ ...
+ SystemExit: 1
+
+
Testing-Module Import Errors
----------------------------
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gc0.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gc0.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gc0.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import unittest
from zope.testing import doctest
def make_sure_gc_is_disabled():
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gc1.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gc1.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gc1.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import unittest
from zope.testing import doctest
def make_sure_gc_threshold_is_one():
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gcset.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gcset.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gcset.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import unittest
from zope.testing import doctest
def make_sure_gc_threshold_is_701_11_9():
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gcstats.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gcstats.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/gcstats.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import unittest
from zope.testing import doctest
def generate_some_gc_statistics():
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/leak.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/leak.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/leak.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -12,7 +12,7 @@
#
##############################################################################
-import unittest, sys, time
+import unittest, time
class ClassicLeakable:
def __init__(self):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/pledge.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/pledge.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/pledge.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import unittest
from zope.testing import doctest
pledge_template = """\
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample21/sampletests_i.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample21/sampletests_i.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample21/sampletests_i.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -12,10 +12,9 @@
#
##############################################################################
+import unittest
import zope.testing.huh
-from zope.testing import doctest
-
class Test(unittest.TestCase):
def test(self):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample22/sampletests_i.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample22/sampletests_i.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample22/sampletests_i.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -13,7 +13,6 @@
##############################################################################
import unittest
-from zope.testing import doctest
class Test(unittest.TestCase):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample23/sampletests_i.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample23/sampletests_i.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sample23/sampletests_i.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -13,7 +13,6 @@
##############################################################################
import unittest
-from zope.testing import doctest
class Test(unittest.TestCase):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_f.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_f.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_f.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -13,7 +13,6 @@
##############################################################################
import unittest
-from zope.testing import doctest
class Test(unittest.TestCase):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex-pp-products/more/sampletests.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex-pp-products/more/sampletests.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex-pp-products/more/sampletests.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -13,7 +13,6 @@
##############################################################################
import unittest
-from zope.testing import doctest
class Test(unittest.TestCase):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex-pp-products/sampletests.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex-pp-products/sampletests.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-ex-pp-products/sampletests.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -13,7 +13,6 @@
##############################################################################
import unittest
-from zope.testing import doctest
class Test(unittest.TestCase):
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-gc.txt
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-gc.txt 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-gc.txt 2009-10-07 16:23:28 UTC (rev 104869)
@@ -62,7 +62,26 @@
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
+Specifying more than 3 --gc options is not allowed:
+
+ >>> from StringIO import StringIO
+ >>> out = StringIO()
+ >>> stdout = sys.stdout
+ >>> sys.stdout = out
+
+ >>> sys.argv = ('test --tests-pattern ^gcset$ --gc 701 --gc 42 --gc 11 --gc 9 -vv'
+ ... .split())
+ >>> _ = testrunner.run_internal(defaults)
+ Traceback (most recent call last):
+ ...
+ SystemExit: 1
+
+ >>> sys.stdout = stdout
+
+ >>> print out.getvalue()
+ Too many --gc options
+
Garbage Collection Statistics
-----------------------------
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-layers-buff.txt
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-layers-buff.txt 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/testrunner/testrunner-layers-buff.txt 2009-10-07 16:23:28 UTC (rev 104869)
@@ -140,3 +140,96 @@
.
LAYER FINISHED
----------------------------------------------------------------------
+
+
+Fake an IOError reading the output of the subprocess to exercise the
+reporting of that error:
+
+ >>> class FakeStdout(object):
+ ... raised = False
+ ... def __init__(self, msg):
+ ... self.msg = msg
+ ... def readline(self):
+ ... if not self.raised:
+ ... self.raised = True
+ ... raise IOError(self.msg)
+
+ >>> class FakeStderr(object):
+ ... def __init__(self, msg):
+ ... self.msg = msg
+ ... def read(self):
+ ... return self.msg
+
+ >>> class FakeProcess(object):
+ ... def __init__(self, out, err):
+ ... self.stdout = FakeStdout(out)
+ ... self.stderr = FakeStderr(err)
+
+ >>> class FakePopen(object):
+ ... def __init__(self, out, err):
+ ... self.out = out
+ ... self.err = err
+ ... def __call__(self, *args, **kw):
+ ... return FakeProcess(self.out, self.err)
+
+ >>> import subprocess
+ >>> Popen = subprocess.Popen
+ >>> subprocess.Popen = FakePopen(
+ ... "Failure triggered to verify error reporting",
+ ... "0 0 0")
+
+ >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
+ >>> from zope.testing import testrunner
+ >>> defaults = [
+ ... '--path', directory_with_tests,
+ ... ]
+ >>> argv = [sys.argv[0],
+ ... '-vv', '--tests-pattern', '^sampletests_buffering.*']
+
+ >>> _ = testrunner.run_internal(defaults, argv)
+ Running tests at level 1
+ Running sampletests_buffering.Layer1 tests:
+ Set up sampletests_buffering.Layer1 in N.NNN seconds.
+ Running:
+ test_something (sampletests_buffering.TestSomething1)
+ Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
+ Running sampletests_buffering.Layer2 tests:
+ Tear down sampletests_buffering.Layer1 ... not supported
+ Error reading subprocess output for sampletests_buffering.Layer2
+ Failure triggered to verify error reporting
+ Total: 1 tests, 0 failures, 0 errors in N.NNN seconds.
+
+Now fake an empty stderr to test reporting a failure when
+communicating with the subprocess:
+
+ >>> subprocess.Popen = FakePopen(
+ ... "Failure triggered to verify error reporting",
+ ... "")
+
+ >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
+ >>> from zope.testing import testrunner
+ >>> defaults = [
+ ... '--path', directory_with_tests,
+ ... ]
+ >>> argv = [sys.argv[0],
+ ... '-vv', '--tests-pattern', '^sampletests_buffering.*']
+
+ >>> _ = testrunner.run_internal(defaults, argv)
+ Running tests at level 1
+ Running sampletests_buffering.Layer1 tests:
+ Set up sampletests_buffering.Layer1 in N.NNN seconds.
+ Running:
+ test_something (sampletests_buffering.TestSomething1)
+ Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
+ Running sampletests_buffering.Layer2 tests:
+ Tear down sampletests_buffering.Layer1 ... not supported
+ Error reading subprocess output for sampletests_buffering.Layer2
+ Failure triggered to verify error reporting
+ <BLANKLINE>
+ **********************************************************************
+ Could not communicate with subprocess
+ **********************************************************************
+ <BLANKLINE>
+ Total: 1 tests, 0 failures, 0 errors in N.NNN seconds.
+
+ >>> subprocess.Popen = Popen
Modified: zope.testing/branches/flakes-and-feathers/src/zope/testing/tests.py
===================================================================
--- zope.testing/branches/flakes-and-feathers/src/zope/testing/tests.py 2009-10-07 16:16:10 UTC (rev 104868)
+++ zope.testing/branches/flakes-and-feathers/src/zope/testing/tests.py 2009-10-07 16:23:28 UTC (rev 104869)
@@ -16,11 +16,9 @@
$Id$
"""
-import os
import re
-import sys
import unittest
-from zope.testing import doctest, testrunner, renormalizing
+from zope.testing import doctest, renormalizing
def test_suite():
return unittest.TestSuite((
More information about the Zope3-Checkins
mailing list