[Checkins] SVN: zope.testrunner/trunk/ No, that's no good.

Lennart Regebro regebro at gmail.com
Wed Apr 28 12:28:59 EDT 2010


Log message for revision 111549:
  No, that's no good.
  

Changed:
  U   zope.testrunner/trunk/MANIFEST.in
  U   zope.testrunner/trunk/setup.py
  U   zope.testrunner/trunk/src/zope/testrunner/debug.py
  U   zope.testrunner/trunk/src/zope/testrunner/find.py
  U   zope.testrunner/trunk/src/zope/testrunner/formatter.py
  U   zope.testrunner/trunk/src/zope/testrunner/options.py
  U   zope.testrunner/trunk/src/zope/testrunner/process.py
  U   zope.testrunner/trunk/src/zope/testrunner/runner.py
  U   zope.testrunner/trunk/src/zope/testrunner/tb_format.py
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-colors.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-debugging-layer-setup.test
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-debugging.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-edge-cases.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-errors.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-ex/pledge.py
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-ex/unicode.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-gc.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-knit.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-layers-api.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-layers-ntd.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-leaks.txt
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-progress.txt
  U   zope.testrunner/trunk/src/zope/testrunner/tests.py

-=-
Modified: zope.testrunner/trunk/MANIFEST.in
===================================================================
--- zope.testrunner/trunk/MANIFEST.in	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/MANIFEST.in	2010-04-28 16:28:58 UTC (rev 111549)
@@ -1,3 +1,3 @@
 include *.txt *.py buildout.cfg
-recursive-include src *.py *.txt *.test
+recursive-include src *.py *.txt *.test sampletests
 # I found no way to include the three empty "sampletests" directories into the sdist :/

Modified: zope.testrunner/trunk/setup.py
===================================================================
--- zope.testrunner/trunk/setup.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/setup.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -22,59 +22,7 @@
 """
 
 import os
-import sys
-if sys.version > '3':
-    extras = dict(
-    use_2to3 = True,
-    convert_2to3_doctests = ['src/zope/testrunner/testrunner-leaks.txt',
-                             'src/zope/testrunner/testrunner-leaks-err.txt',
-                             'src/zope/testrunner/testrunner-progress.txt',
-                             'src/zope/testrunner/testrunner-edge-cases.txt',
-                             'src/zope/testrunner/testrunner-test-selection.txt',
-                             'src/zope/testrunner/testrunner-simple.txt',
-                             'src/zope/testrunner/testrunner-ex/README.txt',
-                             'src/zope/testrunner/testrunner-ex/sampletests.txt',
-                             'src/zope/testrunner/testrunner-ex/usecompiled/README.txt',
-                             'src/zope/testrunner/testrunner-ex/sample3/set_trace5.txt',
-                             'src/zope/testrunner/testrunner-ex/sample3/post_mortem6.txt',
-                             'src/zope/testrunner/testrunner-ex/sample3/post_mortem5.txt',
-                             'src/zope/testrunner/testrunner-ex/sample3/set_trace6.txt',
-                             'src/zope/testrunner/testrunner-ex/sample3/post_mortem_failure.txt',
-                             'src/zope/testrunner/testrunner-ex/sample2/e.txt',
-                             'src/zope/testrunner/testrunner-ex/unicode.txt',
-                             'src/zope/testrunner/testrunner-ex/sampletestsl.txt',
-                             'src/zope/testrunner/testrunner-coverage.txt',
-                             'src/zope/testrunner/testrunner-errors.txt',
-                             'src/zope/testrunner/testrunner-profiling.txt',
-                             'src/zope/testrunner/testrunner-coverage-win32.txt',
-                             'src/zope/testrunner/testrunner-knit.txt',
-                             'src/zope/testrunner/testrunner-subunit-leaks.txt',
-                             'src/zope/testrunner/testrunner-subunit.txt',
-                             'src/zope/testrunner/testrunner-layers-buff.txt',
-                             'src/zope/testrunner/testrunner-arguments.txt',
-                             'src/zope/testrunner/testrunner-shuffle.txt',
-                             'src/zope/testrunner/testrunner-layers-ntd.txt',
-                             'src/zope/testrunner/testrunner-subunit-err.txt',
-                             'src/zope/testrunner/testrunner-gc.txt',
-                             'src/zope/testrunner/testrunner-tb-format.txt',
-                             'src/zope/testrunner/testrunner-layers.txt',
-                             'src/zope/testrunner/testrunner-wo-source.txt',
-                             'src/zope/testrunner/testrunner.txt',
-                             'src/zope/testrunner/testrunner-profiling-cprofiler.txt',
-                             'src/zope/testrunner/testrunner-verbose.txt',
-                             'src/zope/testrunner/testrunner-discovery.txt',
-                             'src/zope/testrunner/testrunner-layers-api.txt',
-                             'src/zope/testrunner/testrunner-colors.txt',
-                             'src/zope/testrunner/testrunner-repeat.txt',
-                             'src/zope/testrunner/testrunner-debugging.txt',
-                             'src/zope/testrunner/testrunner-debugging-layer-setup.test',
-                             ],
-    dependency_links = ['.'], # Until zope.interface 3.6, zope.exception 3.6
-                              # and zope.testing 4.0 has been released.
-    )
-else:
-    extras = {}
-    
+
 from setuptools import setup
 
 chapters = '\n'.join([
@@ -122,13 +70,7 @@
     long_description=long_description,
     author='Zope Foundation and Contributors',
     author_email='zope-dev at zope.org',
-    packages=["zope", 
-              "zope.testrunner", 
-              "zope.testrunner.testrunner-ex",
-              "zope.testrunner.testrunner-ex.sample1",
-              "zope.testrunner.testrunner-ex.sample2",
-              "zope.testrunner.testrunner-ex.sample3",
-              ],
+    packages=["zope", "zope.testrunner"],
     package_dir = {'': 'src'},
     classifiers=[
         "Development Status :: 5 - Production/Stable",
@@ -153,5 +95,5 @@
             ['zope-testrunner = zope.testrunner:run',]},
     include_package_data = True,
     zip_safe = False,
-    **extras
+    dependency_links = ['.'], # Only until the release of zope.testing 4.0.0
 )

Modified: zope.testrunner/trunk/src/zope/testrunner/debug.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/debug.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/debug.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -46,7 +46,7 @@
             except:
                 exc_info = sys.exc_info()
 
-    print "%s.%s:" % (exc_info[0].__module__, exc_info[0].__name__)
+    print "%s:" % (exc_info[0], )
     print exc_info[1]
     pdb.post_mortem(exc_info[2])
     raise zope.testrunner.interfaces.EndRun()

Modified: zope.testrunner/trunk/src/zope/testrunner/find.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/find.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/find.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -69,11 +69,10 @@
     postmortem debugger to indicate that debugging is finished and the
     test run should be terminated:
     
-    XXX This is bloody impossible to test so it works under both Python 2 and 3. /regebro
-    >> try:
-    ..     StartUpFailure(options, None, exc_info)
-    .. finally:
-    ..    sys.stdin = old_stdin
+    >>> try:
+    ...     StartUpFailure(options, None, exc_info)
+    ... finally:
+    ...    sys.stdin = old_stdin
     Traceback (most recent call last):
     EndRun
 
@@ -136,8 +135,8 @@
                 if package:
                     module_name = package + '.' + module_name
 
-                for filter_ in options.module:
-                    if filter_(module_name):
+                for filter in options.module:
+                    if filter(module_name):
                         break
                 else:
                     continue

Modified: zope.testrunner/trunk/src/zope/testrunner/formatter.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/formatter.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/formatter.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -378,17 +378,12 @@
         # avoid reimporting a broken module in python 2.3
         sys.modules['curses'] = None
     else:
-        # If sys.stdout is not a real file object (e.g. in unit tests that 
-        # use various wrappers), you get an error, different depending on
-        # Python version:
-        if sys.version_info >= (3,):
-            import io
-            expected_exceptions = (curses.error, TypeError, io.UnsupportedOperation)
-        else:
-            expected_exceptions = (curses.error, TypeError)
         try:
             curses.setupterm()
-        except expected_exceptions:
+        except (curses.error, TypeError):
+            # You get curses.error when $TERM is set to an unknown name
+            # You get TypeError when sys.stdout is not a real file object
+            # (e.g. in unit tests that use various wrappers).
             pass
         else:
             return curses.tigetnum(attr)

Modified: zope.testrunner/trunk/src/zope/testrunner/options.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/options.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/options.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -492,8 +492,6 @@
     list_tests=False,
     slow_test_threshold=10,
     processes=1,
-    verbose=0,
-    repeat=1,
     )
 
 

Modified: zope.testrunner/trunk/src/zope/testrunner/process.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/process.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/process.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -47,5 +47,3 @@
             print >> self.original_stderr, ' '.join(str(test).strip().split('\n'))
         for test, exc_info in self.runner.errors:
             print >> self.original_stderr, ' '.join(str(test).strip().split('\n'))
-        # You need to flush in Python 3, and it doesn't hurt in Python 2:
-        self.original_stderr.flush()

Modified: zope.testrunner/trunk/src/zope/testrunner/runner.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/runner.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/runner.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -46,6 +46,7 @@
 import zope.testrunner.interfaces
 import zope.testrunner.debug
 import zope.testrunner.tb_format
+import zope.testrunner.shuffle
 
 
 PYREFCOUNT_PATTERN = re.compile('\[[0-9]+ refs\]')
@@ -188,6 +189,7 @@
                 zope.testrunner.garbagecollection.Debug(self))
 
         self.features.append(zope.testrunner.find.Find(self))
+        self.features.append(zope.testrunner.shuffle.Shuffle(self))
         self.features.append(zope.testrunner.process.SubProcess(self))
         self.features.append(zope.testrunner.filter.Filter(self))
         self.features.append(zope.testrunner.listing.Listing(self))
@@ -366,7 +368,7 @@
     except zope.testrunner.interfaces.EndRun:
         raise
     except Exception:
-        f = cStringIO.StringIO()        
+        f = cStringIO.StringIO()
         traceback.print_exc(file=f)
         output.error(f.getvalue())
         errors.append((SetUpLayerFailure(), sys.exc_info()))
@@ -441,10 +443,7 @@
                 break
 
         # Now stderr should be ready to read the whole thing.
-        err = child.stderr.read()
-        if not isinstance(err, str):
-            err = err.decode()
-        erriter = iter(err.splitlines())
+        erriter = iter(child.stderr.read().splitlines())
         nfail = nerr = 0
         for line in erriter:
             try:
@@ -458,16 +457,10 @@
 
         while nfail > 0:
             nfail -= 1
-            # Doing erriter.next().strip() confuses the 2to3 fixer, so
-            # we need to do it on a separate line:
-            next_fail = erriter.next()
-            failures.append((next_fail.strip(), None))
+            failures.append((erriter.next().strip(), None))
         while nerr > 0:
             nerr -= 1
-            # Doing erriter.next().strip() confuses the 2to3 fixer, so
-            # we need to do it on a separate line:
-            next_err = erriter.next()
-            errors.append((next_err.strip(), None))
+            errors.append((erriter.next().strip(), None))
 
     finally:
         result.done = True
@@ -492,8 +485,6 @@
     """Keeps stdout around for later processing,"""
 
     def write(self, out):
-        if not isinstance(out, str): # It's binary, which means it's Python 3
-            out = out.decode()
         if not _is_dots(out):
             self.stdout.append(out)
 
@@ -502,11 +493,6 @@
     """Sends complete output to queue."""
 
     def write(self, out):
-        if not isinstance(out, str):
-            # In Python 3, a Popen process stdout uses bytes,
-            # While normal stdout uses strings. So we need to convert
-            # from bytes to strings here.
-            out = out.decode()
         sys.stdout.write(out)
         # Help keep-alive monitors (human or automated) keep up-to-date.
         sys.stdout.flush()
@@ -525,8 +511,6 @@
     done = property(lambda self: self._done, _set_done)
 
     def write(self, out):
-        if not isinstance(out, str): # It's binary, which means it's Python 3
-            out = out.decode()
         if _is_dots(out):
             self.queue.put((self.layer_name, out.strip()))
         else:
@@ -727,6 +711,8 @@
                                                       " as a subprocess!")
             else:
                 zope.testrunner.debug.post_mortem(exc_info)
+        elif self.options.stop_on_error:
+            self.stop()
 
     def addFailure(self, test, exc_info):
         self.options.output.test_failure(test, time.time() - self._start_time,
@@ -738,6 +724,8 @@
             # XXX: mgedmin: why isn't there a resume_layer check here like
             # in addError?
             zope.testrunner.debug.post_mortem(exc_info)
+        elif self.options.stop_on_error:
+            self.stop()
 
     def stopTest(self, test):
         self.testTearDown()

Modified: zope.testrunner/trunk/src/zope/testrunner/tb_format.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/tb_format.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/tb_format.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -22,26 +22,16 @@
 import zope.testrunner.feature
 
 
-def format_exception(t, v, tb, limit=None, chain=None):
-    if chain:
-        values = traceback._iter_chain(v, tb)
-    else:
-        values = [(v, tb)]
+def format_exception(t, v, tb, limit=None):
     fmt = zope.exceptions.exceptionformatter.TextExceptionFormatter(
         limit=None, with_filenames=True)
-    for v, tb in values:
-        return fmt.formatException(t, v, tb)
+    return fmt.formatException(t, v, tb)
 
 
-def print_exception(t, v, tb, limit=None, file=None, chain=None):
-    if chain:
-        values = traceback._iter_chain(v, tb)
-    else:
-        values = [(v, tb)]
+def print_exception(t, v, tb, limit=None, file=None):
     if file is None:
         file = sys.stdout
-    for v, tb in values:
-        file.writelines(format_exception(t, v, tb, limit))
+    file.writelines(format_exception(t, v, tb, limit))
 
 
 class Traceback(zope.testrunner.feature.Feature):

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-colors.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-colors.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-colors.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -71,7 +71,7 @@
 A failed test run highlights the failures in red:
 
     >>> sys.argv = 'test -c --tests-pattern ^sampletests(f|_e|_f)?$ '.split()
-    >>> testrunner.run_internal(defaults) #doctest: +ELLIPSIS
+    >>> testrunner.run_internal(defaults)
     {normal}Running samplelayers.Layer1 tests:{normal}
       Set up samplelayers.Layer1 in {green}0.000{normal} seconds.
     {normal}  Ran {green}9{normal} tests with {green}0{normal} failures and {green}0{normal} errors in {green}0.001{normal} seconds.{normal}
@@ -117,7 +117,7 @@
     Exception raised:
     {red}    Traceback (most recent call last):{normal}
     {red}      File ".../doctest.py", line 1356, in __run{normal}
-    {red}        compileflags, 1)... test.globs...{normal}
+    {red}        compileflags, 1) in test.globs{normal}
     {red}      File "<doctest sample2.sampletests_e.eek[0]>", line 1, in ?{normal}
     {red}        f(){normal}
     {red}      File "testrunner-ex/sample2/sampletests_e.py", line 19, in f{normal}
@@ -155,7 +155,7 @@
     Exception raised:
     {red}    Traceback (most recent call last):{normal}
     {red}      File ".../doctest.py", line 1356, in __run{normal}
-    {red}        compileflags, 1)... test.globs...{normal}
+    {red}        compileflags, 1) in test.globs{normal}
     {red}      File "<doctest e.txt[1]>", line 1, in ?{normal}
     {red}        f(){normal}
     {red}      File "<doctest e.txt[0]>", line 2, in f{normal}
@@ -176,7 +176,7 @@
     <BLANKLINE>
     {normal}  Ran {green}164{normal} tests with {boldred}3{normal} failures and {boldred}1{normal} errors in {green}0.045{normal} seconds.{normal}
     {normal}Tearing down left over layers:{normal}
-    Tear down zope.testrunner.layer.UnitTests in {green}N.NNN{normal} seconds.
+      Tear down zope.testrunner.layer.UnitTests in {green}N.NNN{normal} seconds.
     {normal}Total: {green}329{normal} tests, {boldred}3{normal} failures, {boldred}1{normal} errors in {green}0.023{normal} seconds.{normal}
     True
 
@@ -200,19 +200,17 @@
     ----------------------------------------------------------------------
     {normal}File testrunner-ex/pledge.py{normal}", line {boldred}26{normal}, in {boldcyan}pledge.pledge{normal}
     Failed example:
-    {cyan}    test_print(){normal}
+    {cyan}    print pledge_template % ('and earthling', 'planet'),{normal}
     Expected:
     {green}    I give my pledge, as an earthling,{normal}
     {green}    to save, and faithfully, to defend from waste,{normal}
     {green}    the natural resources of my planet.{normal}
     {green}    It's soils, minerals, forests, waters, and wildlife.{normal}
-    {green}    <BLANKLINE>{normal}
     Got:
     {red}    I give my pledge, as and earthling,{normal}
     {red}    to save, and faithfully, to defend from waste,{normal}
     {red}    the natural resources of my planet.{normal}
     {red}    It's soils, minerals, forests, waters, and wildlife.{normal}
-    {red}    <BLANKLINE>{normal}
     <BLANKLINE>
     {normal}  Ran {green}1{normal} tests with {boldred}1{normal} failures and {green}0{normal} errors in {green}0.002{normal} seconds.{normal}
     {normal}Tearing down left over layers:{normal}
@@ -234,7 +232,7 @@
     ----------------------------------------------------------------------
     {normal}File testrunner-ex/pledge.py{normal}", line {boldred}26{normal}, in {boldcyan}pledge.pledge{normal}
     Failed example:
-    {cyan}    test_print(){normal}
+    {cyan}    print pledge_template % ('and earthling', 'planet'),{normal}
     Differences (ndiff with -expected +actual):
     {green}    - I give my pledge, as an earthling,{normal}
     {red}    + I give my pledge, as and earthling,{normal}
@@ -242,7 +240,6 @@
     {normal}      to save, and faithfully, to defend from waste,{normal}
     {normal}      the natural resources of my planet.{normal}
     {normal}      It's soils, minerals, forests, waters, and wildlife.{normal}
-    {normal}      <BLANKLINE>{normal}
     <BLANKLINE>
     {normal}  Ran {green}1{normal} tests with {boldred}1{normal} failures and {green}0{normal} errors in {green}0.003{normal} seconds.{normal}
     {normal}Tearing down left over layers:{normal}

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-debugging-layer-setup.test
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-debugging-layer-setup.test	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-debugging-layer-setup.test	2010-04-28 16:28:58 UTC (rev 111549)
@@ -5,7 +5,7 @@
     >>> tdir = tempfile.mkdtemp()
     >>> dir = os.path.join(tdir, 'TESTS-DIR')
     >>> os.mkdir(dir)
-    >>> written = open(os.path.join(dir, 'tests.py'), 'w').write(
+    >>> open(os.path.join(dir, 'tests.py'), 'w').write(
     ... '''
     ... import doctest
     ...
@@ -47,7 +47,7 @@
     ... finally: sys.stdin = real_stdin
     ... # doctest: +ELLIPSIS
     Running tests.Layer tests:
-      Set up tests.Layer ....ValueError:
+      Set up tests.Layer exceptions.ValueError:
     <BLANKLINE>
     > ...tests.py(8)setUp()
     -> raise ValueError
@@ -64,7 +64,7 @@
     ... else:
     ...     sys.stdin = Input('p x\nc')
 
-    >>> written = open(os.path.join(dir, 'tests2.py'), 'w').write(
+    >>> open(os.path.join(dir, 'tests2.py'), 'w').write(
     ... '''
     ... import doctest, unittest
     ...

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-debugging.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-debugging.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-debugging.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -65,11 +65,12 @@
     ...
     Error in test test_post_mortem1 (sample3.sampletests_d.TestSomething)
     Traceback (most recent call last):
-      File "testrunner-ex/sample3/sampletests_d.py", line 34, in test_post_mortem1
+      File "testrunner-ex/sample3/sampletests_d.py",
+              line 34, in test_post_mortem1
         raise ValueError
     ValueError
     <BLANKLINE>
-    ...ValueError:
+    exceptions.ValueError:
     <BLANKLINE>
     > testrunner-ex/sample3/sampletests_d.py(34)test_post_mortem1()
     -> raise ValueError
@@ -83,10 +84,7 @@
 In the example above, we debugged an error.  Failures are actually
 converted to errors and can be debugged the same way:
 
-    >>> if sys.version < '3':
-    ...     sys.stdin = Input('up\np x\np y\nc')     # In Python 2, the failure happens in assertEqual
-    ... else:
-    ...     sys.stdin = Input('up\nup\np x\np y\nc') # In Python 3, the failure happens in a method called from assertEqual
+    >>> sys.stdin = Input('up\np x\np y\nc')
     >>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
     ...             ' -t post_mortem_failure1 -D').split()
     >>> try: testrunner.run_internal(defaults)
@@ -98,17 +96,17 @@
     Traceback (most recent call last):
       File ".../unittest.py",  line 252, in debug
         getattr(self, self.__testMethodName)()
-      File "testrunner-ex/sample3/sampletests_d.py", line 42, in test_post_mortem_failure1
+      File "testrunner-ex/sample3/sampletests_d.py",
+        line 42, in test_post_mortem_failure1
         self.assertEqual(x, y)
       File ".../unittest.py", line 302, in failUnlessEqual
         raise self.failureException, \
     AssertionError: 1 != 2
     <BLANKLINE>
-    builtins.AssertionError:
+    exceptions.AssertionError:
     1 != 2
-    ...
-    > .../unittest.py(302)assertEqual()
-    -> assertion_func(first, second, msg=msg)
+    > .../unittest.py(302)failUnlessEqual()
+    -> ...
     (Pdb) up
     > testrunner-ex/sample3/sampletests_d.py(42)test_post_mortem_failure1()
     -> self.assertEqual(x, y)

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-edge-cases.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-edge-cases.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-edge-cases.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -111,7 +111,8 @@
     ...             ' -t set_trace4').split()
     >>> try: testrunner.run_internal(defaults)
     ... finally: sys.stdin = real_stdin
-    Running zope.testrunner.layer.UnitTests tests:...
+    Running zope.testrunner.layer.UnitTests tests:
+      Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
     > testrunner-ex/sample3/sampletests_d.py(NNN)f()
     -> y = x
     (Pdb) n
@@ -121,8 +122,9 @@
     (Pdb) p x
     1
     (Pdb) c
-      Ran 1 tests with 0 failures and 0 errors in 0.002 seconds.
-    ...
+      Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
+    Tearing down left over layers:
+      Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.
     False
 
 Using pdb in a docstring-based doctest
@@ -132,7 +134,8 @@
     ...             ' -t set_trace3').split()
     >>> try: testrunner.run_internal(defaults)
     ... finally: sys.stdin = real_stdin
-    Running zope.testrunner.layer.UnitTests tests:...
+    Running zope.testrunner.layer.UnitTests tests:
+      Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
     > <doctest sample3.sampletests_d.set_trace3[1]>(3)?()
     -> y = x
     (Pdb) n
@@ -143,10 +146,10 @@
     1
     (Pdb) c
       Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
-    ...
+    Tearing down left over layers:
+      Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.
     False
 
-
 Using pdb.set_trace in a doc file:
 
 
@@ -155,7 +158,8 @@
     ...             ' -t set_trace5').split()
     >>> try: testrunner.run_internal(defaults)
     ... finally: sys.stdin = real_stdin
-    Running zope.testrunner.layer.UnitTests tests:...
+    Running zope.testrunner.layer.UnitTests tests:
+      Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
     > <doctest set_trace5.txt[1]>(3)?()
     -> y = x
     (Pdb) n
@@ -166,10 +170,10 @@
     1
     (Pdb) c
       Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
-    ...
+    Tearing down left over layers:
+      Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.
     False
 
-
 Using pdb.set_trace in a function called by a doctest in a doc file:
 
 
@@ -178,8 +182,9 @@
     ...             ' -t set_trace6').split()
     >>> try: testrunner.run_internal(defaults)
     ... finally: sys.stdin = real_stdin
-    Running zope.testrunner.layer.UnitTests tests:...
-    > testrunner-ex/sample3/sampletests_d.py(42)f()...
+    Running zope.testrunner.layer.UnitTests tests:
+      Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
+    > testrunner-ex/sample3/sampletests_d.py(NNN)f()
     -> y = x
     (Pdb) n
     --Return--
@@ -188,8 +193,9 @@
     (Pdb) p x
     1
     (Pdb) c
-      Ran 1 tests with 0 failures and 0 errors in 0.002 seconds.
-    ...
+      Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
+    Tearing down left over layers:
+      Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.
     False
 
 Post-mortem debugging function called from ordinary test:
@@ -212,7 +218,7 @@
         raise ValueError
     ValueError
     <BLANKLINE>
-    ...ValueError:
+    exceptions.ValueError:
     <BLANKLINE>
     > testrunner-ex/sample3/sampletests_d.py(46)g()
     -> raise ValueError
@@ -230,23 +236,15 @@
     >>> try: testrunner.run_internal(defaults)
     ... finally: sys.stdin = real_stdin
     ... # doctest: +NORMALIZE_WHITESPACE
-    Running zope.testrunner.layer.UnitTests tests:...
+    Running zope.testrunner.layer.UnitTests tests:
+      Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
+    <BLANKLINE>
+    <BLANKLINE>
     Error in test post_mortem3 (sample3.sampletests_d)
     Traceback (most recent call last):
-      File "zope/testing/doctest.py", line 2276, in debug
-        runner.run(self._dt_test)
-      File "zope/testing/doctest.py", line 1731, in run
-        r = DocTestRunner.run(self, test, compileflags, out, False)
-      File "zope/testing/doctest.py", line 1389, in run
-        return self.__run(test, compileflags, out)
-      File "zope/testing/doctest.py", line 1310, in __run
-        exc_info)
-      File "zope/testing/doctest.py", line 1737, in report_unexpected_exception
-        raise UnexpectedException(test, example, exc_info)
-    ...UnexpectedException:
-       from testrunner-ex/sample3/sampletests_d.py:61 (2 examples)>
+    UnexpectedException: testrunner-ex/sample3/sampletests_d.py:NNN (2 examples)>
     <BLANKLINE>
-    ...ValueError:
+    exceptions.ValueError:
     <BLANKLINE>
     > <doctest sample3.sampletests_d.post_mortem3[1]>(1)?()
     (Pdb) p x
@@ -262,24 +260,17 @@
     >>> try: testrunner.run_internal(defaults)
     ... finally: sys.stdin = real_stdin
     ... # doctest: +NORMALIZE_WHITESPACE
-    Running zope.testrunner.layer.UnitTests tests:...
+    Running zope.testrunner.layer.UnitTests tests:
+      Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
+    <BLANKLINE>
+    <BLANKLINE>
     Error in test post_mortem4 (sample3.sampletests_d)
     Traceback (most recent call last):
-      File "zope/testing/doctest.py", line 2276, in debug
-        runner.run(self._dt_test)
-      File "zope/testing/doctest.py", line 1731, in run
-        r = DocTestRunner.run(self, test, compileflags, out, False)
-      File "zope/testing/doctest.py", line 1389, in run
-        return self.__run(test, compileflags, out)
-      File "zope/testing/doctest.py", line 1310, in __run
-        exc_info)
-      File "zope/testing/doctest.py", line 1737, in report_unexpected_exception
-        raise UnexpectedException(test, example, exc_info)
-    ...UnexpectedException: testrunner-ex/sample3/sampletests_d.py:67 (1 example)>
+    UnexpectedException: testrunner-ex/sample3/sampletests_d.py:NNN (1 example)>
     <BLANKLINE>
-    ...ValueError:
+    exceptions.ValueError:
     <BLANKLINE>
-    > testrunner-ex/sample3/sampletests_d.py(46)g()
+    > testrunner-ex/sample3/sampletests_d.py(NNN)g()
     -> raise ValueError
     (Pdb) p x
     1
@@ -294,24 +285,15 @@
     >>> try: testrunner.run_internal(defaults)
     ... finally: sys.stdin = real_stdin
     ... # doctest: +NORMALIZE_WHITESPACE
-    Running zope.testrunner.layer.UnitTests tests:...
+    Running zope.testrunner.layer.UnitTests tests:
+      Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
     <BLANKLINE>
     <BLANKLINE>
-    Error in test zope/testing/testrunner-ex/sample3/post_mortem5.txt
+    Error testrunner-ex/sample3/post_mortem5.txt
     Traceback (most recent call last):
-      File "zope/testing/doctest.py", line 2276, in debug
-        runner.run(self._dt_test)
-      File "zope/testing/doctest.py", line 1731, in run
-        r = DocTestRunner.run(self, test, compileflags, out, False)
-      File "zope/testing/doctest.py", line 1389, in run
-        return self.__run(test, compileflags, out)
-      File "zope/testing/doctest.py", line 1310, in __run
-        exc_info)
-      File "zope/testing/doctest.py", line 1737, in report_unexpected_exception
-        raise UnexpectedException(test, example, exc_info)
-    ...UnexpectedException: testrunner-ex/sample3/post_mortem5.txt:0 (2 examples)>
+    UnexpectedException: testrunner-ex/sample3/post_mortem5.txt:0 (2 examples)>
     <BLANKLINE>
-    ...ValueError:
+    exceptions.ValueError:
     <BLANKLINE>
     > <doctest post_mortem5.txt[1]>(1)?()
     (Pdb) p x
@@ -320,6 +302,7 @@
     True
 
 
+
 Post-mortem debugging function called from file-based doctest:
 
     >>> sys.stdin = Input('p x\nc')
@@ -329,25 +312,26 @@
     ... finally: sys.stdin = real_stdin
     ... # doctest: +NORMALIZE_WHITESPACE
     Running zope.testrunner.layer.UnitTests tests:...
+      Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
     <BLANKLINE>
     <BLANKLINE>
-    Error in test zope/testing/testrunner-ex/sample3/post_mortem6.txt
+    Error testrunner-ex/sample3/post_mortem6.txt
     Traceback (most recent call last):
-      File "zope/testing/doctest.py", line 2276, in debug
-        runner.run(self._dt_test)
-      File "zope/testing/doctest.py", line 1731, in run
+      File ".../zope/testing/doctest/__init__.py", Line NNN, in debug
+        runner.run(self._dt_test, clear_globs=False)
+      File ".../zope/testing/doctest/__init__.py", Line NNN, in run
         r = DocTestRunner.run(self, test, compileflags, out, False)
-      File "zope/testing/doctest.py", line 1389, in run
+      File ".../zope/testing/doctest/__init__.py", Line NNN, in run
         return self.__run(test, compileflags, out)
-      File "zope/testing/doctest.py", line 1310, in __run
+      File ".../zope/testing/doctest/__init__.py", Line NNN, in __run
         exc_info)
-      File "zope/testing/doctest.py", line 1737, in report_unexpected_exception
+      File ".../zope/testing/doctest/__init__.py", Line NNN, in report_unexpected_exception
         raise UnexpectedException(test, example, exc_info)
-    ...UnexpectedException: testrunner-ex/sample3/post_mortem6.txt:0 (2 examples)>
+    UnexpectedException: testrunner-ex/sample3/post_mortem6.txt:0 (2 examples)>
     <BLANKLINE>
-    ...ValueError:
+    exceptions.ValueError:
     <BLANKLINE>
-    > testrunner-ex/sample3/sampletests_d.py(46)g()
+    > testrunner-ex/sample3/sampletests_d.py(NNN)g()
     -> raise ValueError
     (Pdb) p x
     1
@@ -380,7 +364,7 @@
     <BLANKLINE>
     <BLANKLINE>
     > testrunner-ex/sample3/sampletests_d.py(81)_()
-    ...ValueError:
+    exceptions.ValueError:
     Expected and actual output are different
     > <string>(1)...()
     (Pdb) p x
@@ -415,7 +399,7 @@
     <BLANKLINE>
     <BLANKLINE>
     > testrunner-ex/sample3/post_mortem_failure.txt(2)_()
-    ...ValueError:
+    exceptions.ValueError:
     Expected and actual output are different
     > <string>(1)...()
     (Pdb) p x

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-errors.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-errors.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-errors.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -214,8 +214,7 @@
       File "testrunner-ex/sample2/sampletests_e.py", line 28, in eek
     <BLANKLINE>
     ----------------------------------------------------------------------
-    File "testrunner-ex/sample2/sampletests_e.py", line 30,
-           in sample2.sampletests_e.eek
+    File "testrunner-ex/sample2/sampletests_e.py", line 30, in sample2.sampletests_e.eek
     Failed example:
         f()
     Exception raised:
@@ -231,10 +230,10 @@
            - __traceback_info__: I don't know what Y should be.
         NameError: global name 'y' is not defined
     <BLANKLINE>
-        2/47 (4.3%)##r##
-                   ##r##
-        3/47 (6.4%)##r##
-                   ##r##
+        2/47 (4.3%)\r
+                   \r
+        3/47 (6.4%)\r
+                   \r
         4/47 (8.5%)
     <BLANKLINE>
     Error in test test3 (sample2.sampletests_e.Test)
@@ -248,10 +247,10 @@
        - __traceback_info__: I don't know what Y should be.
     NameError: global name 'y' is not defined
     <BLANKLINE>
-        5/47 (10.6%)##r##
-                   ##r##
-        6/47 (12.8%)##r##
-                    ##r##
+        5/47 (10.6%)\r
+                   \r
+        6/47 (12.8%)\r
+                    \r
         7/47 (14.9%)
     <BLANKLINE>
     Failure in test testrunner-ex/sample2/e.txt
@@ -282,84 +281,85 @@
         raise self.failureException, \
     AssertionError: 1 != 0
     <BLANKLINE>
-        9/47 (19.1%)##r##
-                    ##r##
-        10/47 (21.3%)##r##
-                     ##r##
-        11/47 (23.4%)##r##
-                     ##r##
-        12/47 (25.5%)##r##
-                     ##r##
-        13/47 (27.7%)##r##
-                     ##r##
-        14/47 (29.8%)##r##
-                     ##r##
-        15/47 (31.9%)##r##
-                     ##r##
-        16/47 (34.0%)##r##
-                     ##r##
-        17/47 (36.2%)##r##
-                     ##r##
-        18/47 (38.3%)##r##
-                     ##r##
-        19/47 (40.4%)##r##
-                     ##r##
-        20/47 (42.6%)##r##
-                     ##r##
-        21/47 (44.7%)##r##
-                     ##r##
-        22/47 (46.8%)##r##
-                     ##r##
-        23/47 (48.9%)##r##
-                     ##r##
-        24/47 (51.1%)##r##
-                     ##r##
-        25/47 (53.2%)##r##
-                     ##r##
-        26/47 (55.3%)##r##
-                     ##r##
-        27/47 (57.4%)##r##
-                     ##r##
-        28/47 (59.6%)##r##
-                     ##r##
-        29/47 (61.7%)##r##
-                     ##r##
-        30/47 (63.8%)##r##
-                     ##r##
-        31/47 (66.0%)##r##
-                     ##r##
-        32/47 (68.1%)##r##
-                     ##r##
-        33/47 (70.2%)##r##
-                     ##r##
-        34/47 (72.3%)##r##
-                     ##r##
-        35/47 (74.5%)##r##
-                     ##r##
-        36/47 (76.6%)##r##
-                     ##r##
-        37/47 (78.7%)##r##
-                     ##r##
-        38/47 (80.9%)##r##
-                     ##r##
-        39/47 (83.0%)##r##
-                     ##r##
-        40/47 (85.1%)##r##
-                     ##r##
-        41/47 (87.2%)##r##
-                     ##r##
-        42/47 (89.4%)##r##
-                     ##r##
-        43/47 (91.5%)##r##
-                     ##r##
-        44/47 (93.6%)##r##
-                     ##r##
-        45/47 (95.7%)##r##
-                     ##r##
-        46/47 (97.9%)##r##
-                     ##r##
-        47/47 (100.0%)##r##
-                      ##r##
+        9/47 (19.1%)\r
+                    \r
+        10/47 (21.3%)\r
+                     \r
+        11/47 (23.4%)\r
+                     \r
+        12/47 (25.5%)\r
+                     \r
+        13/47 (27.7%)\r
+                     \r
+        14/47 (29.8%)\r
+                     \r
+        15/47 (31.9%)\r
+                     \r
+        16/47 (34.0%)\r
+                     \r
+        17/47 (36.2%)\r
+                     \r
+        18/47 (38.3%)\r
+                     \r
+        19/47 (40.4%)\r
+                     \r
+        20/47 (42.6%)\r
+                     \r
+        21/47 (44.7%)\r
+                     \r
+        22/47 (46.8%)\r
+                     \r
+        23/47 (48.9%)\r
+                     \r
+        24/47 (51.1%)\r
+                     \r
+        25/47 (53.2%)\r
+                     \r
+        26/47 (55.3%)\r
+                     \r
+        27/47 (57.4%)\r
+                     \r
+        28/47 (59.6%)\r
+                     \r
+        29/47 (61.7%)\r
+                     \r
+        30/47 (63.8%)\r
+                     \r
+        31/47 (66.0%)\r
+                     \r
+        32/47 (68.1%)\r
+                     \r
+        33/47 (70.2%)\r
+                     \r
+        34/47 (72.3%)\r
+                     \r
+        35/47 (74.5%)\r
+                     \r
+        36/47 (76.6%)\r
+                     \r
+        37/47 (78.7%)\r
+                     \r
+        38/47 (80.9%)\r
+                     \r
+        39/47 (83.0%)\r
+                     \r
+        40/47 (85.1%)\r
+                     \r
+        41/47 (87.2%)\r
+                     \r
+        42/47 (89.4%)\r
+                     \r
+        43/47 (91.5%)\r
+                     \r
+        44/47 (93.6%)\r
+                     \r
+        45/47 (95.7%)\r
+                     \r
+        46/47 (97.9%)\r
+                     \r
+        47/47 (100.0%)\r
+                      \r
+    <BLANKLINE>
       Ran 47 tests with 3 failures and 1 errors in 0.054 seconds.
     Tearing down left over layers:
       Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.
@@ -476,8 +476,7 @@
       File "testrunner-ex/sample2/sampletests_1.py", line 17, in eek
     <BLANKLINE>
     ----------------------------------------------------------------------
-    File "testrunner-ex/sample2/sampletests_1.py", line 19,
-         in sample2.sampletests_1.eek
+    File "testrunner-ex/sample2/sampletests_1.py", line 19, in sample2.sampletests_1.eek
     Failed example:
         x = y
     Exception raised:
@@ -512,8 +511,7 @@
       File "testrunner-ex/sample2/sampletests_1.py", line 17, in eek
     <BLANKLINE>
     ----------------------------------------------------------------------
-    File "testrunner-ex/sample2/sampletests_1.py", line 19,
-         in sample2.sampletests_1.eek
+    File "testrunner-ex/sample2/sampletests_1.py", line 19, in sample2.sampletests_1.eek
     Failed example:
         x = y
     Exception raised:
@@ -524,8 +522,7 @@
             x = y
         NameError: name 'y' is not defined
     ----------------------------------------------------------------------
-    File "testrunner-ex/sample2/sampletests_1.py", line 21,
-         in sample2.sampletests_1.eek
+    File "testrunner-ex/sample2/sampletests_1.py", line 21, in sample2.sampletests_1.eek
     Failed example:
         x
     Exception raised:
@@ -536,8 +533,7 @@
             x
         NameError: name 'x' is not defined
     ----------------------------------------------------------------------
-    File "testrunner-ex/sample2/sampletests_1.py", line 24,
-         in sample2.sampletests_1.eek
+    File "testrunner-ex/sample2/sampletests_1.py", line 24, in sample2.sampletests_1.eek
     Failed example:
         z = x + 1
     Exception raised:
@@ -575,19 +571,17 @@
     ----------------------------------------------------------------------
     File "testrunner-ex/pledge.py", line 26, in pledge.pledge
     Failed example:
-        test_print()
+        print pledge_template % ('and earthling', 'planet'),
     Expected:
         I give my pledge, as an earthling,
         to save, and faithfully, to defend from waste,
         the natural resources of my planet.
         It's soils, minerals, forests, waters, and wildlife.
-        <BLANKLINE>
     Got:
         I give my pledge, as and earthling,
         to save, and faithfully, to defend from waste,
         the natural resources of my planet.
         It's soils, minerals, forests, waters, and wildlife.
-        <BLANKLINE>
     <BLANKLINE>
       Ran 1 tests with 1 failures and 0 errors in 0.002 seconds.
     Tearing down left over layers:
@@ -617,7 +611,7 @@
     ----------------------------------------------------------------------
     File "testrunner-ex/pledge.py", line 26, in pledge.pledge
     Failed example:
-        test_print()
+        print pledge_template % ('and earthling', 'planet'),
     Differences (ndiff with -expected +actual):
         - I give my pledge, as an earthling,
         + I give my pledge, as and earthling,
@@ -625,7 +619,6 @@
           to save, and faithfully, to defend from waste,
           the natural resources of my planet.
           It's soils, minerals, forests, waters, and wildlife.
-          <BLANKLINE>
     <BLANKLINE>
       Ran 1 tests with 1 failures and 0 errors in 0.003 seconds.
     Tearing down left over layers:
@@ -646,7 +639,7 @@
     ----------------------------------------------------------------------
     File "testrunner-ex/pledge.py", line 26, in pledge.pledge
     Failed example:
-        test_print()
+        print pledge_template % ('and earthling', 'planet'),
     Differences (unified diff with -expected +actual):
         @@ -1,3 +1,3 @@
         -I give my pledge, as an earthling,
@@ -673,7 +666,7 @@
     ----------------------------------------------------------------------
     File "testrunner-ex/pledge.py", line 26, in pledge.pledge
     Failed example:
-        test_print()
+        print pledge_template % ('and earthling', 'planet'),
     Differences (context diff with expected followed by actual):
         ***************
         *** 1,3 ****
@@ -820,14 +813,6 @@
     ----------------------------------------------------------------------
     File testrunner-ex/unicode.txt", Line NNN, in unicode.txt
     Failed example:
-        get_unicode()
-    Expected:
-        oink
-    Got:
-        'foo — bar'
-    ----------------------------------------------------------------------
-    File testrunner-ex/unicode.txt", Line NNN, in unicode.txt
-    Failed example:
         'xyz'
     Expected:
         123

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-ex/pledge.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-ex/pledge.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-ex/pledge.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -22,15 +22,13 @@
 
 def pledge():
     """
-    >>> def test_print():
-    ...     print pledge_template % ('and earthling', 'planet')
-    >>> test_print()
+    >>> print pledge_template % ('and earthling', 'planet'),
     I give my pledge, as an earthling,
     to save, and faithfully, to defend from waste,
     the natural resources of my planet.
     It's soils, minerals, forests, waters, and wildlife.
-    <BLANKLINE>
     """
 
 def test_suite():
     return doctest.DocTestSuite()
+

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-ex/unicode.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-ex/unicode.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-ex/unicode.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -10,7 +10,7 @@
     ...    return u'foo \u2014 bar'
 
     >>> get_unicode()
-    oink
+    u'foo \u2014 bar'
     
     >>> 'foo \xe9'
     'foo \xe9'

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-gc.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-gc.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-gc.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -23,7 +23,7 @@
     Running zope.testrunner.layer.UnitTests tests:
       Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
       Running:
-     make_sure_gc_is_disabled (gc0)...
+     make_sure_gc_is_disabled (gc0)
       Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
     Tearing down left over layers:
       Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.
@@ -40,7 +40,7 @@
     Running zope.testrunner.layer.UnitTests tests:
       Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
       Running:
-     make_sure_gc_threshold_is_one (gc1)...
+     make_sure_gc_threshold_is_one (gc1)
       Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
     Tearing down left over layers:
       Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.
@@ -57,7 +57,7 @@
     Running zope.testrunner.layer.UnitTests tests:
       Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
       Running:
-     make_sure_gc_threshold_is_701_11_9 (gcset)...
+     make_sure_gc_threshold_is_701_11_9 (gcset)
       Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
     Tearing down left over layers:
       Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.
@@ -103,7 +103,7 @@
     Running zope.testrunner.layer.UnitTests tests:
       Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
       Running:
-     generate_some_gc_statistics (gcstats)...
+     generate_some_gc_statistics (gcstats)
       Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
     Tearing down left over layers:
       Tear down zope.testrunner.layer.UnitTests in N.NNN seconds.

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-knit.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-knit.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-knit.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -49,14 +49,14 @@
       Set up samplelayers.Layer11 in 0.000 seconds.
       Set up samplelayers.Layer111 in 0.000 seconds.
       Running:
-        test_x1 (sample1.sampletests.test111.TestA)...
-        test_y0 (sample1.sampletests.test111.TestA)...
+        test_x1 (sample1.sampletests.test111.TestA)
+        test_y0 (sample1.sampletests.test111.TestA)
         ...
-        test_y0 (sampletests.test111)...
-        test_z1 (sampletests.test111)...
+        test_y0 (sampletests.test111)
+        test_z1 (sampletests.test111)
         testrunner-ex/sampletests/../sampletestsl.txt
-        test_extra_test_in_products (sample4.products.sampletests.Test)...
-        test_another_test_in_products (sample4.products.more.sampletests.Test)...
+        test_extra_test_in_products (sample4.products.sampletests.Test)
+        test_another_test_in_products (sample4.products.more.sampletests.Test)
       Ran 28 tests with 0 failures and 0 errors in 0.008 seconds.
     Tearing down left over layers:
       Tear down samplelayers.Layer111 in 0.000 seconds.
@@ -77,8 +77,8 @@
       Set up samplelayers.Layer11 in 0.000 seconds.
       Set up samplelayers.Layer111 in 0.000 seconds.
       Running:
-        test_extra_test_in_products (sample4.products.sampletests.Test)...
-        test_another_test_in_products (sample4.products.more.sampletests.Test)...
+        test_extra_test_in_products (sample4.products.sampletests.Test)
+        test_another_test_in_products (sample4.products.more.sampletests.Test)
       Ran 2 tests with 0 failures and 0 errors in 0.000 seconds.
     Tearing down left over layers:
       Tear down samplelayers.Layer111 in 0.000 seconds.
@@ -95,7 +95,7 @@
       Set up samplelayers.Layer11 in 0.000 seconds.
       Set up samplelayers.Layer111 in 0.000 seconds.
       Running:
-        test_another_test_in_products (sample4.products.more.sampletests.Test)...
+        test_another_test_in_products (sample4.products.more.sampletests.Test)
       Ran 1 tests with 0 failures and 0 errors in 0.000 seconds.
     Tearing down left over layers:
       Tear down samplelayers.Layer111 in 0.000 seconds.

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-layers-api.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-layers-api.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-layers-api.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -113,12 +113,12 @@
 
 >>> from zope.testrunner.runner import Runner
 >>> runner = Runner(options=fresh_options(), args=[], found_suites=[umbrella_suite])
->>> succeeded = runner.run() #doctest: +ELLIPSIS
-Running ...BaseLayer tests:
-  Set up ...BaseLayer in N.NNN seconds.
+>>> succeeded = runner.run()
+Running BaseLayer tests:
+  Set up BaseLayer in N.NNN seconds.
   Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
 Running zope.testrunner.layer.UnitTests tests:
-  Tear down ...BaseLayer in N.NNN seconds.
+  Tear down BaseLayer in N.NNN seconds.
   Set up zope.testrunner.layer.UnitTests in N.NNN seconds.
   Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
 Tearing down left over layers:
@@ -132,12 +132,12 @@
 
 >>> no_layer_suite.layer = BaseLayer
 >>> runner = Runner(options=fresh_options(), args=[], found_suites=[umbrella_suite])
->>> succeeded = runner.run() #doctest: +ELLIPSIS
-Running ...BaseLayer tests:
-  Set up ...BaseLayer in N.NNN seconds.
+>>> succeeded = runner.run()
+Running BaseLayer tests:
+  Set up BaseLayer in N.NNN seconds.
   Ran 4 tests with 0 failures and 0 errors in N.NNN seconds.
 Tearing down left over layers:
-  Tear down ...BaseLayer in N.NNN seconds.
+  Tear down BaseLayer in N.NNN seconds.
 
 Clear our logged output, as we want to inspect it shortly.
 
@@ -151,16 +151,16 @@
 
 >>> TestSpecifyingNoLayer.layer = TopLayer
 >>> runner = Runner(options=fresh_options(), args=[], found_suites=[umbrella_suite])
->>> succeeded = runner.run() #doctest: +ELLIPSIS
-Running ...BaseLayer tests:
-  Set up ...BaseLayer in N.NNN seconds.
+>>> succeeded = runner.run()
+Running BaseLayer tests:
+  Set up BaseLayer in N.NNN seconds.
   Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
-Running ...TopLayer tests:
-  Set up ...TopLayer in N.NNN seconds.
+Running TopLayer tests:
+  Set up TopLayer in N.NNN seconds.
   Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
 Tearing down left over layers:
-  Tear down ...TopLayer in N.NNN seconds.
-  Tear down ...BaseLayer in N.NNN seconds.
+  Tear down TopLayer in N.NNN seconds.
+  Tear down BaseLayer in N.NNN seconds.
 Total: 4 tests, 0 failures, 0 errors in N.NNN seconds.
 
 
@@ -170,11 +170,9 @@
 each test using that layer in the right order.
 
 >>> def report():
-...     print "Report:"
 ...     for record in log_handler.records:
 ...         print record.getMessage()
 >>> report()
-Report:
 BaseLayer.setUp
 BaseLayer.testSetUp
 TestSpecifyingBaseLayer.setUp
@@ -238,47 +236,46 @@
 >>> suite = unittest.makeSuite(DeepTest)
 >>> log_handler.clear()
 >>> runner = Runner(options=fresh_options(), args=[], found_suites=[suite])
->>> succeeded = runner.run() #doctest: +ELLIPSIS
-Running ...F tests:
-  Set up ...A in N.NNN seconds.
-  Set up ...B in N.NNN seconds.
-  Set up ...C in N.NNN seconds.
-  Set up ...D in N.NNN seconds.
-  Set up ...E in N.NNN seconds.
-  Set up ...F in N.NNN seconds.
+>>> succeeded = runner.run()
+Running F tests:
+  Set up A in N.NNN seconds.
+  Set up B in N.NNN seconds.
+  Set up C in N.NNN seconds.
+  Set up D in N.NNN seconds.
+  Set up E in N.NNN seconds.
+  Set up F in N.NNN seconds.
   Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
 Tearing down left over layers:
-  Tear down ...F in N.NNN seconds.
-  Tear down ...E in N.NNN seconds.
-  Tear down ...D in N.NNN seconds.
-  Tear down ...C in N.NNN seconds.
-  Tear down ...B in N.NNN seconds.
-  Tear down ...A in N.NNN seconds.
+  Tear down F in N.NNN seconds.
+  Tear down E in N.NNN seconds.
+  Tear down D in N.NNN seconds.
+  Tear down C in N.NNN seconds.
+  Tear down B in N.NNN seconds.
+  Tear down A in N.NNN seconds.
 
 
->>> report() #doctest: +ELLIPSIS
-Report:
-...A.setUp
-...B.setUp
-...C.setUp
-...D.setUp
-...E.setUp
-...F.setUp
-...A.testSetUp
-...B.testSetUp
-...C.testSetUp
-...D.testSetUp
-...E.testSetUp
-...F.testSetUp
-...F.testTearDown
-...E.testTearDown
-...D.testTearDown
-...C.testTearDown
-...B.testTearDown
-...A.testTearDown
-...F.tearDown
-...E.tearDown
-...D.tearDown
-...C.tearDown
-...B.tearDown
-...A.tearDown
+>>> report()
+A.setUp
+B.setUp
+C.setUp
+D.setUp
+E.setUp
+F.setUp
+A.testSetUp
+B.testSetUp
+C.testSetUp
+D.testSetUp
+E.testSetUp
+F.testSetUp
+F.testTearDown
+E.testTearDown
+D.testTearDown
+C.testTearDown
+B.testTearDown
+A.testTearDown
+F.tearDown
+E.tearDown
+D.tearDown
+C.tearDown
+B.tearDown
+A.tearDown

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-layers-ntd.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-layers-ntd.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-layers-ntd.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -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
+

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-leaks.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-leaks.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-leaks.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -16,7 +16,7 @@
     >>> from zope import testrunner
     
     >>> sys.argv = 'test --layer Layer11$ --layer Layer12$ -N4 -r'.split()
-    >>> _ = testrunner.run(defaults)
+    >>> _ = testrunner.run_internal(defaults)
     Running samplelayers.Layer11 tests:
       Set up samplelayers.Layer1 in 0.000 seconds.
       Set up samplelayers.Layer11 in 0.000 seconds.
@@ -60,7 +60,7 @@
 Let's look at an example test that leaks:
 
     >>> sys.argv = 'test --tests-pattern leak -N4 -r'.split()
-    >>> _ = testrunner.run(defaults)
+    >>> _ = testrunner.run_internal(defaults)
     Running zope.testrunner.layer.UnitTests tests:...
     Iteration 1
       Ran 1 tests with 0 failures and 0 errors in 0.000 seconds.
@@ -81,7 +81,7 @@
 type (or class):
 
     >>> sys.argv = 'test --tests-pattern leak -N5 -r -v'.split()
-    >>> _ = testrunner.run(defaults)
+    >>> _ = testrunner.run_internal(defaults)
     Running tests at level 1
     Running zope.testrunner.layer.UnitTests tests:...
     Iteration 1

Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-progress.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-progress.txt	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-progress.txt	2010-04-28 16:28:58 UTC (rev 111549)
@@ -17,12 +17,12 @@
     >>> from zope import testrunner
     >>> testrunner.run_internal(defaults)
     Running samplelayers.Layer122 tests:
-      Set up samplelayers.Layer1 in 0.000 seconds.
-      Set up samplelayers.Layer12 in 0.000 seconds.
-      Set up samplelayers.Layer122 in 0.000 seconds.
+      Set up samplelayers.Layer1 in N.NNN seconds.
+      Set up samplelayers.Layer12 in N.NNN seconds.
+      Set up samplelayers.Layer122 in N.NNN seconds.
       Running:
-       1/26 (3.8%)##r##
-                  ##r##
+        1/26 (3.8%)##r##
+                   ##r##
         2/26 (7.7%)##r##
                    ##r##
         3/26 (11.5%)##r##
@@ -73,13 +73,15 @@
                      ##r##
         26/26 (100.0%)##r##
                       ##r##
-      Ran 26 tests with 0 failures and 0 errors in 0.008 seconds.
+    <BLANKLINE>
+      Ran 26 tests with 0 failures and 0 errors in N.NNN seconds.
     Tearing down left over layers:
-      Tear down samplelayers.Layer122 in 0.000 seconds.
-      Tear down samplelayers.Layer12 in 0.000 seconds.
-      Tear down samplelayers.Layer1 in 0.000 seconds.
+      Tear down samplelayers.Layer122 in N.NNN seconds.
+      Tear down samplelayers.Layer12 in N.NNN seconds.
+      Tear down samplelayers.Layer1 in N.NNN seconds.
     False
 
+
 (Note that, in the examples above and below, we show "##r##" followed by
 new lines where carriage returns would appear in actual output.)
 
@@ -87,79 +89,79 @@
 output, but only if they fit in the terminal width.  The default
 width, when the terminal width can't be determined, is 80:
 
->>> sys.argv = 'test --layer 122 -pv'.split()
->>> testrunner.run_internal(defaults)
-Running tests at level 1
-Running samplelayers.Layer122 tests:
-  Set up samplelayers.Layer1 in 0.000 seconds.
-  Set up samplelayers.Layer12 in 0.000 seconds.
-  Set up samplelayers.Layer122 in 0.000 seconds.
-  Running:
-    1/26 (3.8%) test_x1 (sample1.sampletests.test122.TestA)##r##
+    >>> sys.argv = 'test --layer 122 -pv'.split()
+    >>> testrunner.run_internal(defaults)
+    Running tests at level 1
+    Running samplelayers.Layer122 tests:
+      Set up samplelayers.Layer1 in N.NNN seconds.
+      Set up samplelayers.Layer12 in N.NNN seconds.
+      Set up samplelayers.Layer122 in N.NNN seconds.
+      Running:
+        1/26 (3.8%) test_x1 (sample1.sampletests.test122.TestA)##r##
+                                                               ##r##
+        2/26 (7.7%) test_y0 (sample1.sampletests.test122.TestA)##r##
+                                                               ##r##
+        3/26 (11.5%) test_z0 (sample1.sampletests.test122.TestA)##r##
+                                                                ##r##
+        4/26 (15.4%) test_x0 (sample1.sampletests.test122.TestB)##r##
+                                                                ##r##
+        5/26 (19.2%) test_y1 (sample1.sampletests.test122.TestB)##r##
+                                                                ##r##
+        6/26 (23.1%) test_z0 (sample1.sampletests.test122.TestB)##r##
+                                                                ##r##
+        7/26 (26.9%) test_1 (sample1.sampletests.test122.TestNotMuch)##r##
+                                                                     ##r##
+        8/26 (30.8%) test_2 (sample1.sampletests.test122.TestNotMuch)##r##
+                                                                     ##r##
+        9/26 (34.6%) test_3 (sample1.sampletests.test122.TestNotMuch)##r##
+                                                                     ##r##
+        10/26 (38.5%) test_x0 (sample1.sampletests.test122)##r##
                                                            ##r##
-    2/26 (7.7%) test_y0 (sample1.sampletests.test122.TestA)##r##
+        11/26 (42.3%) test_y0 (sample1.sampletests.test122)##r##
                                                            ##r##
-    3/26 (11.5%) test_z0 (sample1.sampletests.test122.TestA)##r##
-                                                            ##r##
-    4/26 (15.4%) test_x0 (sample1.sampletests.test122.TestB)##r##
-                                                            ##r##
-    5/26 (19.2%) test_y1 (sample1.sampletests.test122.TestB)##r##
-                                                            ##r##
-    6/26 (23.1%) test_z0 (sample1.sampletests.test122.TestB)##r##
-                                                            ##r##
-    7/26 (26.9%) test_1 (sample1.sampletests.test122.TestNotMuch)##r##
-                                                                 ##r##
-    8/26 (30.8%) test_2 (sample1.sampletests.test122.TestNotMuch)##r##
-                                                                 ##r##
-    9/26 (34.6%) test_3 (sample1.sampletests.test122.TestNotMuch)##r##
-                                                                 ##r##
-    10/26 (38.5%) test_x0 (sample1.sampletests.test122)##r##
-                                                       ##r##
-    11/26 (42.3%) test_y0 (sample1.sampletests.test122)##r##
-                                                       ##r##
-    12/26 (46.2%) test_z1 (sample1.sampletests.test122)##r##
-                                                       ##r##
-    13/26 (50.0%) ... /testrunner-ex/sample1/sampletests/../../sampletestsl.txt##r##
-                                                                               ##r##
-    14/26 (53.8%) test_x1 (sampletests.test122.TestA)##r##
-                                                     ##r##
-    15/26 (57.7%) test_y0 (sampletests.test122.TestA)##r##
-                                                     ##r##
-    16/26 (61.5%) test_z0 (sampletests.test122.TestA)##r##
-                                                     ##r##
-    17/26 (65.4%) test_x0 (sampletests.test122.TestB)##r##
-                                                     ##r##
-    18/26 (69.2%) test_y1 (sampletests.test122.TestB)##r##
-                                                     ##r##
-    19/26 (73.1%) test_z0 (sampletests.test122.TestB)##r##
-                                                     ##r##
-    20/26 (76.9%) test_1 (sampletests.test122.TestNotMuch)##r##
-                                                          ##r##
-    21/26 (80.8%) test_2 (sampletests.test122.TestNotMuch)##r##
-                                                          ##r##
-    22/26 (84.6%) test_3 (sampletests.test122.TestNotMuch)##r##
-                                                          ##r##
-    23/26 (88.5%) test_x0 (sampletests.test122)##r##
-                                               ##r##
-    24/26 (92.3%) test_y0 (sampletests.test122)##r##
-                                               ##r##
-    25/26 (96.2%) test_z1 (sampletests.test122)##r##
-                                               ##r##
-    26/26 (100.0%) ... pe/testing/testrunner-ex/sampletests/../sampletestsl.txt##r##
-                                                                               ##r##
-  Ran 26 tests with 0 failures and 0 errors in 0.008 seconds.
-Tearing down left over layers:
-  Tear down samplelayers.Layer122 in 0.000 seconds.
-  Tear down samplelayers.Layer12 in 0.000 seconds.
-  Tear down samplelayers.Layer1 in 0.000 seconds.
-False
+        12/26 (46.2%) test_z1 (sample1.sampletests.test122)##r##
+                                                           ##r##
+     testrunner-ex/sample1/sampletests/../../sampletestsl.txt##r##
+                                                                                   ##r##
+        14/26 (53.8%) test_x1 (sampletests.test122.TestA)##r##
+                                                         ##r##
+        15/26 (57.7%) test_y0 (sampletests.test122.TestA)##r##
+                                                         ##r##
+        16/26 (61.5%) test_z0 (sampletests.test122.TestA)##r##
+                                                         ##r##
+        17/26 (65.4%) test_x0 (sampletests.test122.TestB)##r##
+                                                         ##r##
+        18/26 (69.2%) test_y1 (sampletests.test122.TestB)##r##
+                                                         ##r##
+        19/26 (73.1%) test_z0 (sampletests.test122.TestB)##r##
+                                                         ##r##
+        20/26 (76.9%) test_1 (sampletests.test122.TestNotMuch)##r##
+                                                              ##r##
+        21/26 (80.8%) test_2 (sampletests.test122.TestNotMuch)##r##
+                                                              ##r##
+        22/26 (84.6%) test_3 (sampletests.test122.TestNotMuch)##r##
+                                                              ##r##
+        23/26 (88.5%) test_x0 (sampletests.test122)##r##
+                                                   ##r##
+        24/26 (92.3%) test_y0 (sampletests.test122)##r##
+                                                   ##r##
+        25/26 (96.2%) test_z1 (sampletests.test122)##r##
+                                                   ##r##
+     testrunner-ex/sampletests/../sampletestsl.txt##r##
+                                                                                   ##r##
+    <BLANKLINE>
+      Ran 26 tests with 0 failures and 0 errors in N.NNN seconds.
+    Tearing down left over layers:
+      Tear down samplelayers.Layer122 in N.NNN seconds.
+      Tear down samplelayers.Layer12 in N.NNN seconds.
+      Tear down samplelayers.Layer1 in N.NNN seconds.
+    False
 
+
 The terminal width is determined using the curses module.  To see
 that, we'll provide a fake curses module:
 
     >>> class FakeCurses:
-    ...     class error(Exception):
-    ...         pass
     ...     def setupterm(self):
     ...         pass
     ...     def tigetnum(self, ignored):
@@ -225,6 +227,7 @@
                                                    ##r##
         26/26 (100.0%) ... r-ex/sampletests/../sampletestsl.txt##r##
                                                                ##r##
+    <BLANKLINE>
       Ran 26 tests with 0 failures and 0 errors in N.NNN seconds.
     Tearing down left over layers:
       Tear down samplelayers.Layer122 in N.NNN seconds.
@@ -232,7 +235,6 @@
       Tear down samplelayers.Layer1 in N.NNN seconds.
     False
 
-
     >>> sys.modules['curses'] = old_curses
 
 If a second or third level of verbosity are added, we get additional

Modified: zope.testrunner/trunk/src/zope/testrunner/tests.py
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/tests.py	2010-04-28 15:59:30 UTC (rev 111548)
+++ zope.testrunner/trunk/src/zope/testrunner/tests.py	2010-04-28 16:28:58 UTC (rev 111549)
@@ -46,6 +46,17 @@
         (re.compile(r"<type 'exceptions.(\w+)Error'>:"),
                     r'exceptions.\1Error:'),
 
+        # Remove '\r', since this only causes confusion.
+        (re.compile(r'\\r', re.MULTILINE), ''),
+        (re.compile(r'\r', re.MULTILINE), ''),
+
+        # testtools content formatter is used to mime-encode
+        # tracebacks when the SubunitOutputFormatter is used, and the
+        # resulting text includes a size which can vary depending on
+        # the path included in the traceback.
+        (re.compile(r'traceback\n[A-F\d]+', re.MULTILINE),
+         r'traceback\nNNN'),
+
         (re.compile("'[A-Za-z]:\\\\"), "'"), # hopefully, we'll make Windows happy
                                              # replaces drives with nothing
 
@@ -61,6 +72,8 @@
         (re.compile(r'\d+[.]\d\d\d seconds'), 'N.NNN seconds'),
         (re.compile(r'\d+[.]\d\d\d s'), 'N.NNN s'),
         (re.compile(r'\d+[.]\d\d\d{'), 'N.NNN{'),
+        (re.compile(r'\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d+'),
+         'YYYY-MM-DD HH:MM:SS.mmmmmm'),
         (re.compile('( |")[^\n]+testrunner-ex'), r'\1testrunner-ex'),
         (re.compile('( |")[^\n]+testrunner.py'), r'\1testrunner.py'),
         (re.compile(r'> [^\n]*(doc|unit)test[.]py\(\d+\)'),
@@ -70,12 +83,12 @@
         (re.compile(r' line \d+,', re.IGNORECASE), r' Line NNN,'),
         (re.compile(r' line {([a-z]+)}\d+{', re.IGNORECASE), r' Line {\1}NNN{'),
 
-        # omit traceback entries for unittest.py or doctest.py from
-        # output:
-        (re.compile(r'^ +File "[^\n]*(doc|unit)test.py", [^\n]+\n[^\n]+\n',
+        # omit traceback entries for unittest.py or doctest.py (and
+        # their package variants) from output:
+        (re.compile(r'^ +File "[^\n]*(doctest|unittest|case)(/__init__)?.py", [^\n]+\n[^\n]+\n',
                     re.MULTILINE),
          r''),
-        (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doc|unit)test.py{\w+}", [^\n]+\n[^\n]+\n',
+        (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doctest|unittest|case)(/__init__)?.py{\w+}", [^\n]+\n[^\n]+\n',
                     re.MULTILINE),
          r''),
         #(re.compile('^> [^\n]+->None$', re.M), '> ...->None'),
@@ -103,6 +116,8 @@
         (re.compile(r'\d+[.]\d\d\d seconds'), 'N.NNN seconds'),
         (re.compile(r'\d+[.]\d\d\d s'), 'N.NNN s'),
         (re.compile(r'\d+[.]\d\d\d{'), 'N.NNN{'),
+        (re.compile(r'\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d+'),
+         'YYYY-MM-DD HH:MM:SS.mmmmmm'),
         (re.compile('( |")[^\n]+testrunner-ex'), r'\1testrunner-ex'),
         (re.compile('( |")[^\n]+testrunner.py'), r'\1testrunner.py'),
         (re.compile(r'> [^\n]*(doc|unit)test[.]py\(\d+\)'),
@@ -112,12 +127,19 @@
         (re.compile(r' line \d+,', re.IGNORECASE), r' Line NNN,'),
         (re.compile(r' line {([a-z]+)}\d+{', re.IGNORECASE), r' Line {\1}NNN{'),
 
-        # omit traceback entries for unittest.py or doctest.py from
-        # output:
-        (re.compile(r'^ +File "[^\n]*(doc|unit)test.py", [^\n]+\n[^\n]+\n',
+        # testtools content formatter is used to mime-encode
+        # tracebacks when the SubunitOutputFormatter is used, and the
+        # resulting text includes a size which can vary depending on
+        # the path included in the traceback.
+        (re.compile(r'traceback\n[A-F\d]+', re.MULTILINE),
+         r'traceback\nNNN'),
+
+        # omit traceback entries for unittest.py or doctest.py (and
+        # their package variants) from output:
+        (re.compile(r'^ +File "[^\n]*(doctest|unittest|case)(/__init__)?.py", [^\n]+\n[^\n]+\n',
                     re.MULTILINE),
          r''),
-        (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doc|unit)test.py{\w+}", [^\n]+\n[^\n]+\n',
+        (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doctest|unittest|case)(/__init__)?.py{\w+}", [^\n]+\n[^\n]+\n',
                     re.MULTILINE),
          r''),
         (re.compile('import pdb; pdb'), 'Pdb()'), # Py 2.3
@@ -163,6 +185,7 @@
         'testrunner-repeat.txt',
         'testrunner-gc.txt',
         'testrunner-knit.txt',
+        'testrunner-shuffle.txt',
         setUp=setUp, tearDown=tearDown,
         optionflags=doctest.ELLIPSIS+doctest.NORMALIZE_WHITESPACE,
         checker=checker),
@@ -250,4 +273,29 @@
             checker=checker,
             )
         )
+
+    try:
+        import subunit
+    except ImportError:
+        suites.append(
+            doctest.DocFileSuite(
+                'testrunner-subunit-err.txt',
+                setUp=setUp, tearDown=tearDown,
+                optionflags=doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE,
+                checker=checker))
+    else:
+        suites.append(
+            doctest.DocFileSuite(
+                'testrunner-subunit.txt',
+                setUp=setUp, tearDown=tearDown,
+                optionflags=doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE,
+                checker=checker))
+        if hasattr(sys, 'gettotalrefcount'):
+            suites.append(
+                doctest.DocFileSuite(
+                    'testrunner-subunit-leaks.txt',
+                    setUp=setUp, tearDown=tearDown,
+                    optionflags=doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE,
+                    checker=checker))
+
     return unittest.TestSuite(suites)



More information about the checkins mailing list