[Zope3-checkins] SVN: zope.testing/branches/ctheune-importchecking/ Backmerge from trunk.
Christian Theune
ct at gocept.com
Fri Jul 3 11:40:55 EDT 2009
Log message for revision 101461:
Backmerge from trunk.
Changed:
U zope.testing/branches/ctheune-importchecking/CHANGES.txt
U zope.testing/branches/ctheune-importchecking/buildout.cfg
U zope.testing/branches/ctheune-importchecking/setup.py
U zope.testing/branches/ctheune-importchecking/src/zope/__init__.py
D zope.testing/branches/ctheune-importchecking/src/zope/testing/DEPENDENCIES.cfg
U zope.testing/branches/ctheune-importchecking/src/zope/testing/doctest.py
U zope.testing/branches/ctheune-importchecking/src/zope/testing/doctest.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/module.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/__init__.py
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/formatter.py
D zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importcheck.py
D zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importcheck.txt
D zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importchecker-fixtures/
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/options.py
A zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/process.py
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/runner.py
D zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/subprocess.py
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-arguments.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-colors.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-coverage.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-debugging-layer-setup.test
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-debugging.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-edge-cases.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-errors.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_1.py
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-gc.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-knit.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-layers-ntd.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-layers.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-leaks-err.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-profiling-cprofiler.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-profiling.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-progress.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-repeat.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-simple.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-test-selection.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-verbose.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-wo-source.txt
U zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/tests.py
U zope.testing/branches/ctheune-importchecking/src/zope/testing/tests.py
-=-
Modified: zope.testing/branches/ctheune-importchecking/CHANGES.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/CHANGES.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/CHANGES.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -1,19 +1,73 @@
zope.testing Changelog
**********************
-3.7.2 (unreleased)
+3.7.7 (unreleased)
==================
-- Added feature that warns about re-imports of symbols that originate
- from a different location. This allows detecting when classes and
- functions get moved from one module to another.
+- ...
+3.7.6 (2009-07-02)
+==================
+
+- Add zope-testrunner console_scripts entry point. This exposes a
+ zope-testrunner binary with default installs allowing the testrunner to be
+ run from the command line.
+
+3.7.5 (2009-06-08)
+==================
+
+- Fix bug when running subprocesses on Windows.
+
+- The option REPORT_ONLY_FIRST_FAILURE (command line option "-1") is now
+ respected even when a doctest declares its own REPORTING_FLAGS, such as
+ REPORT_NDIFF.
+
+- Fixed bug that broke readline with pdb when using doctest
+ (see http://bugs.python.org/issue5727).
+
+- Made tests pass on Windows and Linux at the same time.
+
+
+3.7.4 (2009-05-01)
+==================
+
+- Filenames of doctest examples now contain the line number and not
+ only the example number. So a stack trace in pdb tells the exact
+ line number of the current example. This fixes
+ https://bugs.launchpad.net/bugs/339813
+
+- Colorization of doctest output correctly handles blank lines.
+
+
+3.7.3 (2009-04-22)
+==================
+
+- Better deal with rogue threads by always exiting with status so even
+ spinning daemon threads won't block the runner from exiting. This deprecated
+ the ``--with-exit-status`` option.
+
+
+3.7.2 (2009-04-13)
+==================
+
+- fix test failure on Python 2.4 because of slight difference in the way
+ coverage is reported (__init__ files with only a single comment line are now
+ not reported)
+- fixed bug that caused the test runner to hang when running subprocesses (as a
+ result Python 2.3 is no longer supported).
+- there is apparently a bug in Python 2.6 (related to
+ http://bugs.python.org/issue1303673) that causes the profile tests to fail.
+- added explanitory notes to buildout.cfg about how to run the tests with
+ multiple versions of Python
+
+
3.7.1 (2008-10-17)
==================
- The setupstack temporary-directory support now properly handles
read-only files by making them writable before removing them.
+
3.7.0 (2008-09-22)
==================
Modified: zope.testing/branches/ctheune-importchecking/buildout.cfg
===================================================================
--- zope.testing/branches/ctheune-importchecking/buildout.cfg 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/buildout.cfg 2009-07-03 15:40:55 UTC (rev 101461)
@@ -2,23 +2,33 @@
develop = .
parts = test
-find-links = http://download.zope.org/distribution/
-
[test]
recipe = zc.recipe.testrunner
eggs = zope.testing
-[test23]
-python = python23
-recipe = zc.recipe.testrunner
-eggs = zope.testing
+# The [test2X] sections below are to make testing with various Python versions
+# easier. You'll need entries in your default.cfg that point to the location
+# that your various versions of Python are installed. Like so:
+#
+# [python2.4]
+# executable = /usr/local/bin/python2.4
+#
+# And then run "bin/buildout install test24 test25 test26" to build the
+# version-specific test scripts. Once that's done you ran run "bin/test24"
+# (etc.).
+
[test24]
-python = python24
+python = python2.4
recipe = zc.recipe.testrunner
eggs = zope.testing
[test25]
-python = python25
+python = python2.5
recipe = zc.recipe.testrunner
eggs = zope.testing
+
+[test26]
+python = python2.6
+recipe = zc.recipe.testrunner
+eggs = zope.testing
Modified: zope.testing/branches/ctheune-importchecking/setup.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/setup.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/setup.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -25,6 +25,7 @@
install_requires = ['setuptools',
'zope.interface'],
extras_require={'zope_tracebacks': 'zope.exceptions'},
+ entry_points = {'console_scripts': ['zope-testrunner = zope.testing.testrunner:run',]},
include_package_data = True,
zip_safe = False,
)
@@ -79,14 +80,29 @@
setup(
name='zope.testing',
- version='3.7.2dev',
+ version = '3.7.7dev',
url='http://pypi.python.org/pypi/zope.testing',
license='ZPL 2.1',
description='Zope testing framework, including the testrunner script.',
long_description=long_description,
author='Zope Corporation and Contributors',
- author_email='zope3-dev at zope.org',
+ author_email='zope-dev at zope.org',
packages=["zope", "zope.testing"],
package_dir = {'': 'src'},
+
+ classifiers=[
+ "Development Status :: 5 - Production/Stable",
+ "Environment :: Console",
+ "Framework :: Zope3",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Zope Public License",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python :: 2.4",
+ "Programming Language :: Python :: 2.5",
+ "Programming Language :: Python :: 2.6",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Topic :: Software Development :: Testing",
+ ],
+
**extra)
Modified: zope.testing/branches/ctheune-importchecking/src/zope/__init__.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/__init__.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/__init__.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -1,7 +1 @@
-# namespace package boilerplate
-try:
- __import__('pkg_resources').declare_namespace(__name__)
-except ImportError, e:
- from pkgutil import extend_path
- __path__ = extend_path(__path__, __name__)
-
+__import__('pkg_resources').declare_namespace(__name__)
Deleted: zope.testing/branches/ctheune-importchecking/src/zope/testing/DEPENDENCIES.cfg
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/DEPENDENCIES.cfg 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/DEPENDENCIES.cfg 2009-07-03 15:40:55 UTC (rev 101461)
@@ -1 +0,0 @@
-zope.exceptions
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/doctest.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/doctest.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/doctest.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -355,9 +355,11 @@
self.__out = out
self.__debugger_used = False
try:
- pdb.Pdb.__init__(self, stdin=sys.stdin, stdout=out)
+ pdb.Pdb.__init__(self, stdin=sys.stdin, stdout=out)
except TypeError:
- pdb.Pdb.__init__(self)
+ pdb.Pdb.__init__(self)
+ # enable readline
+ self.use_rawinput = 1
def set_trace(self):
self.__debugger_used = True
@@ -1345,7 +1347,10 @@
# Use a special filename for compile(), so we can retrieve
# the source code during interactive debugging (see
# __patched_linecache_getlines).
- filename = '<doctest %s[%d]>' % (test.name, examplenum)
+ # Line number counting starts with 0 so we add one to get
+ # the real line number.
+ filename = '<doctest %s[line %d, example %d]>' % (
+ test.name, example.lineno+1, examplenum)
# Run the example in the given context (globs), and record
# any exception that gets raised. (But don't intercept
@@ -1428,9 +1433,10 @@
self.failures += f
self.tries += t
- __LINECACHE_FILENAME_RE = re.compile(r'<doctest '
- r'(?P<name>[\w\.]+)'
- r'\[(?P<examplenum>\d+)\]>$')
+ __LINECACHE_FILENAME_RE = re.compile(
+ r'<doctest (?P<name>[\w\.]+)\[line \d+, example (?P<examplenum>\d+)\]>$'
+ )
+
def __patched_linecache_getlines(self, filename, module_globals=None):
m = self.__LINECACHE_FILENAME_RE.match(filename)
if m and m.group('name') == self.test.name:
@@ -2305,6 +2311,9 @@
# so add the default reporting flags
optionflags |= _unittest_reportflags
+ if _unittest_reportflags & REPORT_ONLY_FIRST_FAILURE:
+ optionflags |= REPORT_ONLY_FIRST_FAILURE
+
runner = DocTestRunner(optionflags=optionflags,
checker=self._dt_checker, verbose=False)
def write(value):
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/doctest.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/doctest.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/doctest.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -4,7 +4,7 @@
Most `doctest` module tests are located within the module. This file only
tests a few additional features not covered by the module tests, so that the
-changes to the `doctest` module -- which is forked from the Python stanadrd
+changes to the `doctest` module -- which is forked from the Python standard
library -- are minimized.
Working with Carriage Returns
@@ -12,7 +12,7 @@
Due to the way releases are made on different platforms, we sometimes test
files on a *nix system with Windows file endings. Unfortunately, that leaves
-some the tests broken:
+some of the test files broken:
>>> import tempfile
>>> fn = tempfile.mktemp()
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/module.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/module.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/module.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -89,7 +89,7 @@
>>> import zope.testing.unlikelymodulename
Traceback (most recent call last):
...
- ImportError: No module named zope.testing.unlikelymodulename
+ ImportError: No module named unlikelymodulename
This only works for packages that already exist::
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/__init__.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/__init__.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/__init__.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -23,16 +23,26 @@
import zope.testing.testrunner.interfaces
+def run(defaults=None, args=None):
+ """Main runner function which can be and is being used from main programs.
-def run(defaults=None, args=None):
- # This function is here to make the whole test runner compatible before
- # the large refactoring.
+ Will execute the tests and exit the process according to the test result.
+
+ """
+ failed = run_internal(defaults, args)
+ sys.exit(int(failed))
+
+
+def run_internal(defaults=None, args=None):
+ """Execute tests.
+
+ Returns whether errors or failures occured during testing.
+
+ """
# XXX Bah. Lazy import to avoid circular/early import problems
from zope.testing.testrunner.runner import Runner
runner = Runner(defaults, args)
runner.run()
- if runner.failed and runner.options.exitwithstatus:
- sys.exit(1)
return runner.failed
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/formatter.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/formatter.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/formatter.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -584,12 +584,15 @@
self.color('normal'), '\n'])
else:
print line
- elif line.startswith(' '):
+ elif line.startswith(' ') or line.strip() == '':
if colorize_diff and len(line) > 4:
color = self.diff_color.get(line[4], color_of_indented_text)
print self.colorize(color, line)
else:
- print self.colorize(color_of_indented_text, line)
+ if line.strip() != '':
+ print self.colorize(color_of_indented_text, line)
+ else:
+ print line
else:
colorize_diff = False
if line.startswith('Failed example'):
Deleted: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importcheck.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importcheck.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importcheck.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -1,230 +0,0 @@
-# vim:fileencoding=utf-8
-# Copyright (c) 2008 gocept gmbh & co. kg
-# See also LICENSE.txt
-
-# XXX: Is there *any* way to detect instances that are shuffled around?
-
-import ihooks
-import os.path
-import sys
-import types
-import zope.testing.testrunner.feature
-import inspect
-
-
-WHITELIST = [('re', 'match', 'sre'),
- ('new', 'module', '__builtin__'),
- ('os', 'error', 'exceptions')]
-
-wrapper_cache = {}
-seen = set()
-
-
-def guess_package_name(frame):
- """Guess which package a code frame originated from."""
- if '__name__' in frame.f_globals:
- return frame.f_globals['__name__']
- filename = frame.f_globals['__file__']
- for mod in sys.modules.values():
- if not hasattr(mod, '__file__'):
- continue
- if os.path.dirname(mod.__file__) == os.path.dirname(filename):
- return mod.__name__
- raise RuntimeError("Can't guess module name for %r" % frame)
-
-
-def rule_whitelist(import_mod, name, real_mod):
- # No warning for things on the whitelist.
- return (import_mod, name, real_mod) in WHITELIST
-
-
-def rule_doctest(import_mod, name, real_mod):
- # doctest regularly sticks stuff somewhere else. We
- # ignore those.
- return real_mod in ['doctest', 'zope.testing.doctest']
-
-
-def rule_stdlib_and_builtins(import_mod, name, real_mod):
- # Some builtins are redirected within the stdlib (and vice versa)
- if import_mod == 'sys' and name in ['stdin', 'stdout']:
- return True
- if import_mod == 'os' and real_mod == 'posix':
- return True
- if name == '__class__' and real_mod == '__builtin__':
- return True
- if import_mod == '__builtin__' and real_mod == 'exceptions':
- return True
- if (import_mod == 'types' or
- import_mod.startswith('xml.dom')) and real_mod == '__builtin__':
- # No warning for the types from the type module that
- # really originate from builtins
- return True
-
-
-def rule_intra_package_reimport(import_mod, name, real_mod):
- # Don't warn if the package of a module re-exports a symbol.
- return import_mod.split('.') == real_mod.split('.')[:-1]
-
-
-def rule_intra_package_reimport2(import_mod, name, real_mod):
- # Don't warn if symbols of an underscore module are reimported
- # by a module belonging to the same package.
- real_path = real_mod.split('.')
- real_module = real_path[-1]
- base = '.'.join(real_path[:-1]) + '.'
- return real_module.startswith('_') and import_mod.startswith(base)
-
-
-def rule_unclean_c_module(import_mod, name, real_mod):
- # The real module seems to be a C-Module which is regularly masked using
- # another Python module in front of it.
- if (real_mod in sys.modules and
- hasattr(sys.modules[real_mod], '__file__')):
- real_file = sys.modules[real_mod].__file__
- extension = os.path.splitext(real_file)[1]
- if not extension.startswith('.py'):
- return True
- if real_mod.startswith('_') and real_mod == import_mod.split('.')[-1]:
- # Looks like a C-module which doesn't declare its
- # package path correctly.
- return True
-
-
-def rule_zope_deferredimport(import_mod, name, real_mod):
- if real_mod == 'zope.deferredimport.deferredmodule':
- return True
-
-
-def rule_internal_underscore_reimport(import_mod, name, real_mod):
- # Looks like an internal module, prefixed with _ was exported to the same
- # module name without an _
- return real_mod.split('.')[-1] == '_' + import_mod.split('.')[-1]
-
-
-
-RULES = [func for name, func in locals().items()
- if name.startswith('rule_')]
-
-
-class IndirectAttributeAccessChecker(types.ModuleType):
-
- def __init__(self, module, options):
- self.__import_checker_module = module
- self.__import_checker_options = options
-
- def __eq__(self, other):
- if isinstance(other, IndirectAttributeAccessChecker):
- other = (
- other._IndirectAttributeAccessChecker__import_checker_module)
- return other == self._IndirectAttributeAccessChecker__import_checker_module
-
- def __setattr__(self, name, value):
- if name.startswith('_IndirectAttributeAccessChecker__import_checker_'):
- object.__setattr__(self, name.replace('_IndirectAttributeAccessChecker', ''), value)
- else:
- module = self.__import_checker_module
- setattr(module, name, value)
-
- def __getattribute__(self, name):
- if name.startswith('_IndirectAttributeAccessChecker__import_checker_'):
- return object.__getattribute__(self, name.replace('_IndirectAttributeAccessChecker', ''))
- module = self.__import_checker_module
- attr = getattr(module, name)
- if not isinstance(attr,
- (types.ClassType, types.TypeType, types.FunctionType)):
- return attr
- if attr.__module__ == module.__name__:
- return attr
-
- frame = sys._getframe(1)
- show_only_from = self.__import_checker_options.indirect_source
- if show_only_from:
- for include in show_only_from:
- if guess_package_name(frame).startswith(include):
- break
- else:
- # This warning was caused in a module not under the
- # `indirect source` parameter.
- return attr
-
- import_mod, real_mod = module.__name__, attr.__module__
- for rule in RULES:
- # Warning suppression rules: if no rule matches, we display
- # a warning.
- if rule(import_mod, name, real_mod):
- break
- else:
- attr_type = type(attr).__name__
- file = frame.f_code.co_filename
- line = frame.f_lineno
- signature = (import_mod, name, real_mod, file, line)
- if signature not in seen:
- print ("WARNING: indirect import of %s `%s.%s` (originally defined at `%s`)"
- % (attr_type, import_mod, name, real_mod))
- print "caused at %s:%s" % (file, line)
- seen.add(signature)
-
- return attr
-
-
-class IndirectImportWarner(ihooks.ModuleImporter):
-
- def __init__(self, options):
- ihooks.ModuleImporter.__init__(self)
- self.options = options
-
- def import_module(self, name, globals=None, locals=None,
- fromlist=None):
- result = ihooks.ModuleImporter.import_module(
- self, name, globals=globals, locals=locals, fromlist=fromlist)
- if id(result) not in wrapper_cache:
- checker = IndirectAttributeAccessChecker(
- result, self.options)
- if not hasattr(result, '__all__'):
- # Support * imports
- checker.__all__ = [x for x in dir(result) if not
- x.startswith('_')]
- wrapper_cache[id(result)] = checker
- return wrapper_cache[id(result)]
-
- def import_it(self, partname, fqname, parent, force_load=0):
- result = ihooks.ModuleImporter.import_it(self, partname, fqname,
- parent, force_load)
- if result is not None:
- if hasattr(result, '__file__') and not '.' in os.path.basename(result.__file__):
- # Smells like a package which didn't get __init__.py
- # attached to its path.
- result.__file__ = os.path.join(result.__file__, '__init__.py')
- return result
-
- def determine_parent(self, globals):
- if not globals or not "__name__" in globals:
- return None
- pname = globals['__name__']
- if "__path__" in globals:
- parent = self.modules[pname]
- # XXX The original class used to use an `assert` here which
- # conflicts with doctest creating copys of the globs.
- # assert globals is parent.__dict__
- return parent
- if '.' in pname:
- i = pname.rfind('.')
- pname = pname[:i]
- parent = self.modules[pname]
- assert parent.__name__ == pname
- return parent
- return None
-
-
-class ImportChecker(zope.testing.testrunner.feature.Feature):
- """Monitor indirect imports and warn about them."""
-
- active = True
-
- def global_setup(self):
- if self.runner.options.indirect_imports:
- ihooks.install(IndirectImportWarner(self.runner.options))
-
- def global_teardown(self):
- if self.runner.options.indirect_imports:
- ihooks.uninstall()
Deleted: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importcheck.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importcheck.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/importcheck.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -1,107 +0,0 @@
-=============
-Import checks
-=============
-
-Import checks are intended to help finding imports of classes and
-functions that have been moved and are still referred to by their old
-location. We usually re-import them at their old location to keep code
-working, but for cleaning up, it's nice to get a heads-up where we still
-refer to the old locations.
-
-Note: Only objects that support `__module__` can be checked for indirect
-reports. This is especially *not* true for instances.
-
-Test-runner integration
-=======================
-
-This test (as it is a test for the test runner) assumes that the test
-runner has the import check enabled. We extend Python's search path to
-include some example modules that trigger the import checker:
-
->>> import sys, os.path
->>> import zope.testing.testrunner
->>> sys.path.insert(0, os.path.join(os.path.dirname(
-... zope.testing.testrunner.__file__), 'importchecker-fixtures'))
-
-When importing a function or a class from a module that isn't its
-original place of definition, a warning will be printed:
-
->>> import impcheck0
->>> import impcheck0a
->>> import impcheck0b
-WARNING: indirect import of type `impcheck0a.X` (originally defined at `impcheck0`)
-caused at ...impcheck0b.py:NNN
-WARNING: indirect import of function `impcheck0a.y` (originally defined at `impcheck0`)
-caused at ...impcheck0b.py:NNN
-
-
-Heuristics for ignoring re-imports
-==================================
-
-Indirect imports in the standard library
-----------------------------------------
-
-The standard library uses reimports to hide some lower level modules which is
-ok for us.
-
-The types in the `type` module come originally from `__builtin__`. This is ok
-for us and we ignore that:
-
->>> from types import NoneType
->>> NoneType.__module__
-'__builtin__'
-
-The `os` module tends to reimport from locations like `posix`:
-
->>> from os import unlink
->>> unlink.__module__
-'posix'
-
-The `re` module imports its content from the `sre` module:
-
->>> from re import match
-
-
-Indirect imports due to the testing environment
------------------------------------------------
-
-The test runner and `doctest` redirect the stdout temporarily, so sys.stdout
-can be ignored as well:
-
->>> from sys import stdout
->>> stdout.__module__
-'zope.testing.doctest'
-
-
-Indirect imports from packages and their sub-modules
-----------------------------------------------------
-
-We allow indirect imports for the sake of providing an API within a package
-that hides its (sub-)modules. E.g. the following structure is ok, as X is
-defined in module `impcheck1.sub1` and re-imported from `impcheck1`:
-
->>> from impcheck1 import X
->>> from impcheck1.sub1 import X
-
-
-However, we do not allow re-imports from sibling modules:
-
->>> from impcheck1.sub2 import X
-WARNING: indirect import of type `impcheck1.sub2.X` (originally defined at `impcheck1.sub1`)
-caused at <doctest importcheck.txt[15]>:1
-
-
-Also, we only allow one level of re-importing via modules:
-
->>> from impcheck1 import Y
-WARNING: indirect import of type `impcheck1.Y` (originally defined at `impcheck1.sub3.sub3a`)
-caused at <doctest importcheck.txt[16]>:1
-
-
-Indirect imports from C-modules
--------------------------------
-
-Often there are indirect imports from modules that are written in C to provide
-a nicer API for it. We ignore symbols that are re-imported from C:
-
->>> from curses import setupterm
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/options.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/options.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/options.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -314,20 +314,6 @@
Run the tests under pychecker
""")
-analysis.add_option(
- '--indirect-imports', '-i', action="store_true", dest='indirect_imports',
- help="""\
-Inject an import hook and report usage of indirectly imported classes
-and functions.
-""")
-
-analysis.add_option(
- '--indirect-source', action="append", dest='indirect_source',
- help="""\
-Only report indirect imports that originated in the given package or
-module (or one of its sub-packages or sub-modules).
-""")
-
parser.add_option_group(analysis)
######################################################################
@@ -420,13 +406,6 @@
other = optparse.OptionGroup(parser, "Other", "Other options")
other.add_option(
- '--exit-with-status', action="store_true", dest='exitwithstatus',
- help="""\
-Return an error exit status if the tests failed. This can be useful for
-an invoking process that wants to monitor the result of a test run.
-""")
-
-other.add_option(
'-j', action="store", type="int", dest='processes',
help="""\
Use up to given number of parallel processes to execute tests. May decrease
@@ -458,6 +437,12 @@
compilation to .pyc/.pyo. Use of this option implies --keepbytecode.
""")
+other.add_option(
+ '--exit-with-status', action="store_true", dest='exitwithstatus',
+ help="""DEPRECATED: The test runner will always exit with a status.\
+""")
+
+
parser.add_option_group(other)
######################################################################
@@ -531,7 +516,6 @@
args = sys.argv
options, positional = parser.parse_args(args[1:], defaults)
-
options.original_testrunner_args = args
if options.color:
Copied: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/process.py (from rev 101395, zope.testing/trunk/src/zope/testing/testrunner/process.py)
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/process.py (rev 0)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/process.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -0,0 +1,44 @@
+##############################################################################
+#
+# Copyright (c) 2004-2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Subprocess support.
+
+$Id: __init__.py 86218 2008-05-03 14:17:26Z ctheune $
+"""
+
+import sys
+import time
+import zope.testing.testrunner.feature
+
+
+class SubProcess(zope.testing.testrunner.feature.Feature):
+ """Lists all tests in the report instead of running the tests."""
+
+ def __init__(self, runner):
+ super(SubProcess, self).__init__(runner)
+ self.active = bool(runner.options.resume_layer)
+
+ def global_setup(self):
+ self.original_stderr = sys.stderr
+ sys.stderr = sys.stdout
+ self.runner.options.verbose = False
+
+ def report(self):
+ sys.stdout.close()
+ # Communicate with the parent. The protocol is obvious:
+ print >> self.original_stderr, self.runner.ran, \
+ len(self.runner.failures), len(self.runner.errors)
+ for test, exc_info in self.runner.failures:
+ 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'))
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/runner.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/runner.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -16,6 +16,8 @@
$Id: __init__.py 86232 2008-05-03 15:09:33Z ctheune $
"""
+import subprocess
+
import cStringIO
import gc
import glob
@@ -43,12 +45,10 @@
import zope.testing.testrunner.garbagecollection
import zope.testing.testrunner.listing
import zope.testing.testrunner.statistics
-import zope.testing.testrunner.subprocess
+import zope.testing.testrunner.process
import zope.testing.testrunner.interfaces
import zope.testing.testrunner.debug
-import zope.testing.testrunner.importcheck
-
PYREFCOUNT_PATTERN = re.compile('\[[0-9]+ refs\]')
is_jython = sys.platform.startswith('java')
@@ -189,11 +189,10 @@
self.features.append(zope.testing.testrunner.garbagecollection.Debug(self))
self.features.append(zope.testing.testrunner.find.Find(self))
- self.features.append(zope.testing.testrunner.subprocess.SubProcess(self))
+ self.features.append(zope.testing.testrunner.process.SubProcess(self))
self.features.append(zope.testing.testrunner.filter.Filter(self))
self.features.append(zope.testing.testrunner.listing.Listing(self))
self.features.append(zope.testing.testrunner.statistics.Statistics(self))
- self.features.append(zope.testing.testrunner.importcheck.ImportChecker(self))
# Remove all features that aren't activated
self.features = [f for f in self.features if f.active]
@@ -403,47 +402,29 @@
for feature in features:
feature.layer_setup(layer)
- subin, subout, suberr = os.popen3(args)
- while True:
- try:
- for line in subout:
- result.stdout.append(line)
- except IOError, e:
- if e.errno == errno.EINTR:
- # If the reading the subprocess input is interruped (as
- # be caused by recieving SIGCHLD), then retry.
- continue
- options.output.error(
- "Error reading subprocess output for %s" % layer_name)
- options.output.info(str(e))
- else:
- break
+ child = subprocess.Popen(args, shell=False, stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ close_fds=not sys.platform.startswith('win'))
+ subout, suberr = child.communicate()
- # The subprocess may have spewed any number of things to stderr, so
- # we'll keep looking until we find the information we're looking for.
- whole_suberr = ''
- while True:
- line = suberr.readline()
- whole_suberr += line
- if not line:
- raise SubprocessError(
- 'No subprocess summary found', repr(whole_suberr))
-
+ erriter = iter(suberr.splitlines())
+ for line in erriter:
try:
result.num_ran, nfail, nerr = map(int, line.strip().split())
- break
- except KeyboardInterrupt:
- raise
- except:
+ except ValueError:
continue
+ else:
+ break
while nfail > 0:
nfail -= 1
- failures.append((suberr.readline().strip(), None))
+ failures.append((erriter.next().strip(), None))
while nerr > 0:
nerr -= 1
- errors.append((suberr.readline().strip(), None))
+ errors.append((erriter.next().strip(), None))
+ result.stdout.append(subout)
+
finally:
result.done = True
@@ -491,7 +472,6 @@
current_result = results_iter.next()
except StopIteration:
current_result = None
-
time.sleep(0.01) # Keep the loop from being too tight.
# Return the total number of tests run.
Deleted: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/subprocess.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/subprocess.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/subprocess.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -1,44 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004-2008 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Subprocess support.
-
-$Id: __init__.py 86218 2008-05-03 14:17:26Z ctheune $
-"""
-
-import sys
-import time
-import zope.testing.testrunner.feature
-
-
-class SubProcess(zope.testing.testrunner.feature.Feature):
- """Lists all tests in the report instead of running the tests."""
-
- def __init__(self, runner):
- super(SubProcess, self).__init__(runner)
- self.active = bool(runner.options.resume_layer)
-
- def global_setup(self):
- self.original_stderr = sys.stderr
- sys.stderr = sys.stdout
- self.runner.options.verbose = False
-
- def report(self):
- sys.stdout.close()
- # Communicate with the parent. The protocol is obvious:
- print >> self.original_stderr, self.runner.ran, \
- len(self.runner.failures), len(self.runner.errors)
- for test, exc_info in self.runner.failures:
- 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'))
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-arguments.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-arguments.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-arguments.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -12,7 +12,7 @@
... '--tests-pattern', '^sampletestsf?$',
... ]
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults, 'test --layer 111'.split())
+ >>> testrunner.run_internal(defaults, 'test --layer 111'.split())
Running samplelayers.Layer111 tests:
Set up samplelayers.Layerx in N.NNN seconds.
Set up samplelayers.Layer1 in N.NNN seconds.
@@ -38,7 +38,7 @@
... '--tests-pattern', '^sampletestsf?$',
... ]
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults, 'test --layer 111'.split())
+ >>> testrunner.run_internal(defaults, 'test --layer 111'.split())
Listing samplelayers.Layer111 tests:
test_x1 (sample1.sampletests.test111.TestA)
test_y0 (sample1.sampletests.test111.TestA)
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-colors.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-colors.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-colors.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -52,7 +52,7 @@
A successful test run soothes the developer with warm green colors:
>>> sys.argv = 'test --layer 122 -c'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
{normal}Running samplelayers.Layer122 tests:{normal}
Set up samplelayers.Layer1 in {green}0.000{normal} seconds.
Set up samplelayers.Layer12 in {green}0.000{normal} seconds.
@@ -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(defaults)
+ >>> 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}
@@ -118,7 +118,7 @@
{red} Traceback (most recent call last):{normal}
{red} File ".../doctest.py", line 1356, in __run{normal}
{red} compileflags, 1) in test.globs{normal}
- {red} File "<doctest sample2.sampletests_e.eek[0]>", line 1, in ?{normal}
+ {red} File "<doctest sample2.sampletests_e.eek[line 2, example 0]>", line 1, in ?{normal}
{red} f(){normal}
{red} File "testrunner-ex/sample2/sampletests_e.py", line 19, in f{normal}
{red} g(){normal}
@@ -154,9 +154,9 @@
{red} Traceback (most recent call last):{normal}
{red} File ".../doctest.py", line 1356, in __run{normal}
{red} compileflags, 1) in test.globs{normal}
- {red} File "<doctest e.txt[1]>", line 1, in ?{normal}
+ {red} File "<doctest e.txt[line 4, example 1]>", line 1, in ?{normal}
{red} f(){normal}
- {red} File "<doctest e.txt[0]>", line 2, in f{normal}
+ {red} File "<doctest e.txt[line 1, example 0]>", line 2, in f{normal}
{red} return x{normal}
{red} NameError: global name 'x' is not defined{normal}
<BLANKLINE>
@@ -186,7 +186,7 @@
colors:
>>> sys.argv = 'test --tests-pattern ^pledge$ -c'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
{normal}Running zope.testing.testrunner.layer.UnitTests tests:{normal}
Set up zope.testing.testrunner.layer.UnitTests in {green}N.NNN{normal} seconds.
<BLANKLINE>
@@ -218,7 +218,7 @@
apart:
>>> sys.argv = 'test --tests-pattern ^pledge$ --ndiff -c'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
{normal}Running zope.testing.testrunner.layer.UnitTests tests:{normal}
Set up zope.testing.testrunner.layer.UnitTests in {green}N.NNN{normal} seconds.
<BLANKLINE>
@@ -243,14 +243,44 @@
{normal}Tearing down left over layers:{normal}
Tear down zope.testing.testrunner.layer.UnitTests in {green}N.NNN{normal} seconds.
+Even test failures that have actual blank lines (as opposed to <BLANKLINE>) in
+them are highlighted correctly.
+ >>> import zope.testing.testrunner.formatter
+ >>> formatter = zope.testing.testrunner.formatter.ColorfulOutputFormatter(None)
+ >>> formatter.print_doctest_failure("""\
+ ... File "sometest.txt", line 221, in sometest.txt
+ ... Failed example:
+ ... foo()
+ ... Expected:
+ ... Output that contains
+ ...
+ ... blank lines.
+ ... Got:
+ ... Output that still contains
+ ...
+ ... blank lines.""")
+ {normal} File "sometest.txt", line 221, in sometest.txt{normal}
+ Failed example:
+ {cyan} foo(){normal}
+ Expected:
+ {green} Output that contains{normal}
+ <BLANKLINE>
+ {green} blank lines.{normal}
+ Got:
+ {red} Output that still contains{normal}
+ <BLANKLINE>
+ {red} blank lines.{normal}
+ <BLANKLINE>
+
+
Timing individual tests
-----------------------
At very high verbosity levels you can see the time taken by each test
>>> sys.argv = 'test -u -t test_one.TestNotMuch -c -vvv'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
{normal}Running tests at level 1{normal}
{normal}Running zope.testing.testrunner.layer.UnitTests tests:{normal}
Set up zope.testing.testrunner.layer.UnitTests in {green}N.NNN{normal} seconds.
@@ -272,7 +302,7 @@
in the test runner to 0 seconds to make all of the tests seem slow.
>>> sys.argv = 'test -u -t test_one.TestNotMuch -c -vvv --slow-test 0'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
{normal}Running tests at level 1{normal}
{normal}Running zope.testing.testrunner.layer.UnitTests tests:{normal}
Set up zope.testing.testrunner.layer.UnitTests in {green}N.NNN{normal} seconds.
@@ -298,7 +328,7 @@
--no-color options will disable colorized output:
>>> sys.argv = 'test --layer 122 -c -C'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
Set up samplelayers.Layer12 in 0.000 seconds.
@@ -311,7 +341,7 @@
False
>>> sys.argv = 'test --layer 122 -c --no-color'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
Set up samplelayers.Layer12 in 0.000 seconds.
@@ -332,7 +362,7 @@
pretends it is a terminal, but the curses module will realize it isn't:
>>> sys.argv = 'test --layer 122 --auto-color'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
Set up samplelayers.Layer12 in 0.000 seconds.
@@ -356,7 +386,7 @@
>>> sys.modules['curses'] = FakeCurses()
>>> sys.argv = 'test --layer 122 --auto-color'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
{normal}Running samplelayers.Layer122 tests:{normal}
Set up samplelayers.Layer1 in {green}0.000{normal} seconds.
Set up samplelayers.Layer12 in {green}0.000{normal} seconds.
@@ -375,7 +405,7 @@
>>> sys.stdout = real_stdout
>>> sys.argv = 'test --layer 122 --auto-color'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
Set up samplelayers.Layer12 in 0.000 seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-coverage.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-coverage.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-coverage.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -15,7 +15,7 @@
>>> sys.argv = 'test --coverage=coverage_dir'.split()
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer1 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
Ran 9 tests with 0 failures and 0 errors in 0.000 seconds.
@@ -52,31 +52,7 @@
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
lines cov% module (path)
- 1 100% sample1.__init__ (testrunner-ex/sample1/__init__.py)
- 1 100% sample1.sample11.__init__ (testrunner-ex/sample1/sample11/__init__.py)
- 74 86% sample1.sample11.sampletests (testrunner-ex/sample1/sample11/sampletests.py)
- 1 100% sample1.sample13.__init__ (testrunner-ex/sample1/sample13/__init__.py)
- 48 100% sample1.sample13.sampletests (testrunner-ex/sample1/sample13/sampletests.py)
- 1 100% sample1.sampletests.__init__ (testrunner-ex/sample1/sampletests/__init__.py)
- 48 100% sample1.sampletests.test1 (testrunner-ex/sample1/sampletests/test1.py)
- 74 100% sample1.sampletests.test11 (testrunner-ex/sample1/sampletests/test11.py)
- 74 100% sample1.sampletests.test111 (testrunner-ex/sample1/sampletests/test111.py)
- 74 100% sample1.sampletests.test112 (testrunner-ex/sample1/sampletests/test112.py)
- 74 100% sample1.sampletests.test12 (testrunner-ex/sample1/sampletests/test12.py)
- 74 100% sample1.sampletests.test121 (testrunner-ex/sample1/sampletests/test121.py)
- 74 100% sample1.sampletests.test122 (testrunner-ex/sample1/sampletests/test122.py)
- 48 100% sample1.sampletests.test_one (testrunner-ex/sample1/sampletests/test_one.py)
- 48 100% sample1.sampletestsf (testrunner-ex/sample1/sampletestsf.py)
- 1 100% sample2.__init__ (testrunner-ex/sample2/__init__.py)
- 1 100% sample2.sample21.__init__ (testrunner-ex/sample2/sample21/__init__.py)
- 48 100% sample2.sample21.sampletests (testrunner-ex/sample2/sample21/sampletests.py)
- 1 100% sample2.sampletests.__init__ (testrunner-ex/sample2/sampletests/__init__.py)
- 48 100% sample2.sampletests.test_1 (testrunner-ex/sample2/sampletests/test_1.py)
- 48 100% sample2.sampletests.testone (testrunner-ex/sample2/sampletests/testone.py)
- 1 100% sample3.__init__ (testrunner-ex/sample3/__init__.py)
- 48 100% sample3.sampletests (testrunner-ex/sample3/sampletests.py)
- 84 85% samplelayers (testrunner-ex/samplelayers.py)
- 1 100% sampletests.__init__ (testrunner-ex/sampletests/__init__.py)
+ ...
48 100% sampletests.test1 (testrunner-ex/sampletests/test1.py)
74 100% sampletests.test11 (testrunner-ex/sampletests/test11.py)
74 100% sampletests.test111 (testrunner-ex/sampletests/test111.py)
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-debugging-layer-setup.test
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-debugging-layer-setup.test 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-debugging-layer-setup.test 2009-07-03 15:40:55 UTC (rev 101461)
@@ -43,7 +43,7 @@
>>> sys.argv = [testrunner_script]
>>> import zope.testing.testrunner
>>> try:
- ... zope.testing.testrunner.run(['--path', dir, '-D'])
+ ... zope.testing.testrunner.run_internal(['--path', dir, '-D'])
... finally: sys.stdin = real_stdin
... # doctest: +ELLIPSIS
Running tests.Layer tests:
@@ -98,9 +98,10 @@
>>> import sys
>>> try:
- ... zope.testing.testrunner.run(
+ ... zope.testing.testrunner.run_internal(
... ['--path', dir, '-Dvv', '--tests-pattern', 'tests2'])
... finally: sys.stdin = real_stdin
+ ... # doctest: +ELLIPSIS +REPORT_NDIFF
Running tests at level 1
Running tests2.Layer1 tests:
Set up tests2.Layer1 in 0.000 seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-debugging.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-debugging.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-debugging.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -32,7 +32,7 @@
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t set_trace1').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +ELLIPSIS
Running zope.testing.testrunner.layer.UnitTests tests:
@@ -58,7 +58,7 @@
>>> sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem1 -D').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE +REPORT_NDIFF
Running zope.testing.testrunner.layer.UnitTests tests:
@@ -87,7 +87,7 @@
>>> 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(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE +REPORT_NDIFF
Running zope.testing.testrunner.layer.UnitTests tests:
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-edge-cases.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-edge-cases.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-edge-cases.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -22,20 +22,18 @@
... '--tests-pattern', '^sampletestsf?$',
... ]
>>> sys.argv = ['test']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
... # doctest: +ELLIPSIS
Test-module import failures:
<BLANKLINE>
Module: sampletestsf
<BLANKLINE>
- Traceback (most recent call last):
- ...
ImportError: No module named sampletestsf
...
>>> sys.path.append(directory_with_tests)
>>> sys.argv = ['test']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
... # doctest: +ELLIPSIS
Running samplelayers.Layer1 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
@@ -73,7 +71,7 @@
... sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t set_trace2').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +ELLIPSIS
Running zope.testing.testrunner.layer.UnitTests tests:...
@@ -91,7 +89,7 @@
>>> sys.stdin = Input('n\np x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t set_trace4').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
Running zope.testing.testrunner.layer.UnitTests tests:...
--Return--
@@ -112,14 +110,14 @@
>>> sys.stdin = Input('n\np x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t set_trace3').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
Running zope.testing.testrunner.layer.UnitTests tests:...
--Return--
> doctest.py(351)set_trace()->None
-> pdb.Pdb.set_trace(self)
(Pdb) n
- > <doctest sample3.sampletests_d.set_trace3[1]>(3)...()
+ > <doctest sample3.sampletests_d.set_trace3[line 3, example 1]>(3)...()
-> y = x
(Pdb) p x
1
@@ -134,14 +132,14 @@
>>> sys.stdin = Input('n\np x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t set_trace5').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
Running zope.testing.testrunner.layer.UnitTests tests:...
--Return--
> doctest.py(351)set_trace()->None
-> pdb.Pdb.set_trace(self)
(Pdb) n
- > <doctest set_trace5.txt[1]>(3)...()
+ > <doctest set_trace5.txt[line 2, example 1]>(3)...()
-> y = x
(Pdb) p x
1
@@ -157,7 +155,7 @@
>>> sys.stdin = Input('n\np x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t set_trace6').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
Running zope.testing.testrunner.layer.UnitTests tests:...
--Return--
@@ -178,7 +176,7 @@
>>> sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem2 -D').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:...
@@ -208,7 +206,7 @@
>>> sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem3 -D').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:...
@@ -229,7 +227,7 @@
<BLANKLINE>
exceptions.ValueError:
<BLANKLINE>
- > <doctest sample3.sampletests_d.post_mortem3[1]>(1)...()
+ > <doctest sample3.sampletests_d.post_mortem3[line 3, example 1]>(1)...()
(Pdb) p x
1
(Pdb) c
@@ -240,7 +238,7 @@
>>> sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem4 -D').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:...
@@ -272,7 +270,7 @@
>>> sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem5 -D').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:...
@@ -294,7 +292,7 @@
<BLANKLINE>
exceptions.ValueError:
<BLANKLINE>
- > <doctest post_mortem5.txt[1]>(1)...()
+ > <doctest post_mortem5.txt[line 2, example 1]>(1)...()
(Pdb) p x
1
(Pdb) c
@@ -306,7 +304,7 @@
>>> sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem6 -D').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:...
@@ -340,7 +338,7 @@
>>> sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem_failure2 -D').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:...
@@ -375,7 +373,7 @@
>>> sys.stdin = Input('p x\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem_failure.txt -D').split()
- >>> try: testrunner.run(defaults)
+ >>> try: testrunner.run_internal(defaults)
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:...
@@ -407,7 +405,7 @@
Post-mortem debugging with triple verbosity
>>> sys.argv = 'test --layer samplelayers.Layer1$ -vvv -D'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer1 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
@@ -432,7 +430,7 @@
>>> sys.argv = ['test',
... '--tests-pattern', '^sampletests_none_suite$',
... ]
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Test-module import failures:
<BLANKLINE>
Module: sample1.sampletests_none_suite
@@ -450,7 +448,7 @@
>>> sys.argv = ['test',
... '--tests-pattern', '^sampletests_none_test$',
... ]
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Test-module import failures:
<BLANKLINE>
Module: sample1.sampletests_none_test
@@ -471,7 +469,7 @@
repeat count greater than 1
>>> sys.argv = 'test -r'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
You must use the --repeat (-N) option to specify a repeat
count greater than 1 when using the --report_refcounts (-r)
option.
@@ -479,7 +477,7 @@
True
>>> sys.argv = 'test -r -N1'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
You must use the --repeat (-N) option to specify a repeat
count greater than 1 when using the --report_refcounts (-r)
option.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-errors.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-errors.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-errors.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -16,7 +16,7 @@
... for f in files:
... shutil.copy(os.path.join(root, f),
... os.path.join(directory_with_tests, root[n:], f))
-
+
>>> from zope.testing import testrunner
>>> defaults = [
... '--path', directory_with_tests,
@@ -24,7 +24,7 @@
... ]
>>> sys.argv = 'test --tests-pattern ^sampletests(f|_e|_f)?$ '.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
Running samplelayers.Layer1 tests:
...
@@ -44,7 +44,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_e.eek[0]>", line 1, in ?
+ File "<doctest sample2.sampletests_e.eek[line 2, example 0]>", line 1, in ?
f()
File "testrunner-ex/sample2/sampletests_e.py", line 19, in f
g()
@@ -78,9 +78,9 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest e.txt[1]>", line 1, in ?
+ File "<doctest e.txt[line 4, example 1]>", line 1, in ?
f()
- File "<doctest e.txt[0]>", line 2, in f
+ File "<doctest e.txt[line 1, example 0]>", line 2, in f
return x
NameError: global name 'x' is not defined
<BLANKLINE>
@@ -108,7 +108,7 @@
there'll be a summary of the errors at the end of the test:
>>> sys.argv = 'test --tests-pattern ^sampletests(f|_e|_f)?$ -uv'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
... # doctest: +NORMALIZE_WHITESPACE +REPORT_NDIFF
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
@@ -129,7 +129,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_e.eek[0]>", line 1, in ?
+ File "<doctest sample2.sampletests_e.eek[line 2, example 0]>", line 1, in ?
f()
File "testrunner-ex/sample2/sampletests_e.py", line 19, in f
g()
@@ -164,9 +164,9 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest e.txt[1]>", line 1, in ?
+ File "<doctest e.txt[line 4, example 1]>", line 1, in ?
f()
- File "<doctest e.txt[0]>", line 2, in f
+ File "<doctest e.txt[line 1, example 0]>", line 2, in f
return x
NameError: global name 'x' is not defined
<BLANKLINE>
@@ -198,7 +198,7 @@
>>> sys.argv = ('test --tests-pattern ^sampletests(f|_e|_f)?$ -u -ssample2'
... ' -p').split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
... # doctest: +NORMALIZE_WHITESPACE +REPORT_NDIFF
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -218,7 +218,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_e.eek[0]>", line 1, in ?
+ File "<doctest sample2.sampletests_e.eek[line 2, example 0]>", line 1, in ?
f()
File "testrunner-ex/sample2/sampletests_e.py", line 19, in f
g()
@@ -226,10 +226,10 @@
x = y + 1
NameError: global name 'y' is not defined
<BLANKLINE>
- 2/56 (3.6%)\r
- \r
- 3/56 (5.4%)\r
- \r
+ 2/56 (3.6%)##r##
+ ##r##
+ 3/56 (5.4%)##r##
+ ##r##
4/56 (7.1%)
<BLANKLINE>
Error in test test3 (sample2.sampletests_e.Test)
@@ -242,10 +242,10 @@
x = y + 1
NameError: global name 'y' is not defined
<BLANKLINE>
- 5/56 (8.9%)\r
- \r
- 6/56 (10.7%)\r
- \r
+ 5/56 (8.9%)##r##
+ ##r##
+ 6/56 (10.7%)##r##
+ ##r##
7/56 (12.5%)
<BLANKLINE>
Failure in test testrunner-ex/sample2/e.txt
@@ -260,9 +260,9 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest e.txt[1]>", line 1, in ?
+ File "<doctest e.txt[line 4, example 1]>", line 1, in ?
f()
- File "<doctest e.txt[0]>", line 2, in f
+ File "<doctest e.txt[line 1, example 0]>", line 2, in f
return x
NameError: global name 'x' is not defined
<BLANKLINE>
@@ -276,85 +276,84 @@
raise self.failureException, \
AssertionError: 1 != 0
<BLANKLINE>
- 9/56 (16.1%)\r
- \r
- 10/56 (17.9%)\r
- \r
- 11/56 (19.6%)\r
- \r
- 12/56 (21.4%)\r
- \r
- 13/56 (23.2%)\r
- \r
- 14/56 (25.0%)\r
- \r
- 15/56 (26.8%)\r
- \r
- 16/56 (28.6%)\r
- \r
- 17/56 (30.4%)\r
- \r
- 18/56 (32.1%)\r
- \r
- 19/56 (33.9%)\r
- \r
- 20/56 (35.7%)\r
- \r
- 24/56 (42.9%)\r
- \r
- 25/56 (44.6%)\r
- \r
- 26/56 (46.4%)\r
- \r
- 27/56 (48.2%)\r
- \r
- 28/56 (50.0%)\r
- \r
- 29/56 (51.8%)\r
- \r
- 30/56 (53.6%)\r
- \r
- 31/56 (55.4%)\r
- \r
- 32/56 (57.1%)\r
- \r
- 33/56 (58.9%)\r
- \r
- 34/56 (60.7%)\r
- \r
- 35/56 (62.5%)\r
- \r
- 36/56 (64.3%)\r
- \r
- 40/56 (71.4%)\r
- \r
- 41/56 (73.2%)\r
- \r
- 42/56 (75.0%)\r
- \r
- 43/56 (76.8%)\r
- \r
- 44/56 (78.6%)\r
- \r
- 45/56 (80.4%)\r
- \r
- 46/56 (82.1%)\r
- \r
- 47/56 (83.9%)\r
- \r
- 48/56 (85.7%)\r
- \r
- 49/56 (87.5%)\r
- \r
- 50/56 (89.3%)\r
- \r
- 51/56 (91.1%)\r
- \r
- 52/56 (92.9%)\r
- \r
- 56/56 (100.0%)\r
- \r
- <BLANKLINE>
+ 9/56 (16.1%)##r##
+ ##r##
+ 10/56 (17.9%)##r##
+ ##r##
+ 11/56 (19.6%)##r##
+ ##r##
+ 12/56 (21.4%)##r##
+ ##r##
+ 13/56 (23.2%)##r##
+ ##r##
+ 14/56 (25.0%)##r##
+ ##r##
+ 15/56 (26.8%)##r##
+ ##r##
+ 16/56 (28.6%)##r##
+ ##r##
+ 17/56 (30.4%)##r##
+ ##r##
+ 18/56 (32.1%)##r##
+ ##r##
+ 19/56 (33.9%)##r##
+ ##r##
+ 20/56 (35.7%)##r##
+ ##r##
+ 24/56 (42.9%)##r##
+ ##r##
+ 25/56 (44.6%)##r##
+ ##r##
+ 26/56 (46.4%)##r##
+ ##r##
+ 27/56 (48.2%)##r##
+ ##r##
+ 28/56 (50.0%)##r##
+ ##r##
+ 29/56 (51.8%)##r##
+ ##r##
+ 30/56 (53.6%)##r##
+ ##r##
+ 31/56 (55.4%)##r##
+ ##r##
+ 32/56 (57.1%)##r##
+ ##r##
+ 33/56 (58.9%)##r##
+ ##r##
+ 34/56 (60.7%)##r##
+ ##r##
+ 35/56 (62.5%)##r##
+ ##r##
+ 36/56 (64.3%)##r##
+ ##r##
+ 40/56 (71.4%)##r##
+ ##r##
+ 41/56 (73.2%)##r##
+ ##r##
+ 42/56 (75.0%)##r##
+ ##r##
+ 43/56 (76.8%)##r##
+ ##r##
+ 44/56 (78.6%)##r##
+ ##r##
+ 45/56 (80.4%)##r##
+ ##r##
+ 46/56 (82.1%)##r##
+ ##r##
+ 47/56 (83.9%)##r##
+ ##r##
+ 48/56 (85.7%)##r##
+ ##r##
+ 49/56 (87.5%)##r##
+ ##r##
+ 50/56 (89.3%)##r##
+ ##r##
+ 51/56 (91.1%)##r##
+ ##r##
+ 52/56 (92.9%)##r##
+ ##r##
+ 56/56 (100.0%)##r##
+ ##r##
Ran 56 tests with 3 failures and 1 errors in 0.054 seconds.
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -371,7 +370,7 @@
examples in the same test to fail. Each failure is reported:
>>> sys.argv = 'test --tests-pattern ^sampletests_1$'.split()
- >>> testrunner.run(defaults) # doctest: +NORMALIZE_WHITESPACE
+ >>> testrunner.run_internal(defaults) # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -389,7 +388,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_1.eek[0]>", line 1, in ?
+ File "<doctest sample2.sampletests_1.eek[line 2, example 0]>", line 1, in ?
x = y
NameError: name 'y' is not defined
----------------------------------------------------------------------
@@ -401,7 +400,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_1.eek[1]>", line 1, in ?
+ File "<doctest sample2.sampletests_1.eek[line 4, example 1]>", line 1, in ?
x
NameError: name 'x' is not defined
----------------------------------------------------------------------
@@ -413,7 +412,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_1.eek[2]>", line 1, in ?
+ File "<doctest sample2.sampletests_1.eek[line 7, example 2]>", line 1, in ?
z = x + 1
NameError: name 'x' is not defined
<BLANKLINE>
@@ -428,7 +427,7 @@
me the first failed example in a doctest" :)
>>> sys.argv = 'test --tests-pattern ^sampletests_1$ -1'.split()
- >>> testrunner.run(defaults) # doctest:
+ >>> testrunner.run_internal(defaults) # doctest:
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -446,7 +445,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_1.eek[0]>", line 1, in ?
+ File "<doctest sample2.sampletests_1.eek[line 2, example 0]>", line 1, in ?
x = y
NameError: name 'y' is not defined
<BLANKLINE>
@@ -461,7 +460,7 @@
... 'test --tests-pattern ^sampletests_1$'
... ' --hide-secondary-failures'
... ).split()
- >>> testrunner.run(defaults) # doctest:
+ >>> testrunner.run_internal(defaults) # doctest:
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -479,7 +478,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_1.eek[0]>", line 1, in ?
+ File "<doctest sample2.sampletests_1.eek[line 2, example 0]>", line 1, in ?
x = y
NameError: name 'y' is not defined
<BLANKLINE>
@@ -497,7 +496,7 @@
... 'test --tests-pattern ^sampletests_1$'
... ' --hide-secondary-failures --show-secondary-failures'
... ).split()
- >>> testrunner.run(defaults) # doctest: +NORMALIZE_WHITESPACE
+ >>> testrunner.run_internal(defaults) # doctest: +NORMALIZE_WHITESPACE
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -515,7 +514,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_1.eek[0]>", line 1, in ?
+ File "<doctest sample2.sampletests_1.eek[line 2, example 0]>", line 1, in ?
x = y
NameError: name 'y' is not defined
----------------------------------------------------------------------
@@ -527,7 +526,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_1.eek[1]>", line 1, in ?
+ File "<doctest sample2.sampletests_1.eek[line 4, example 1]>", line 1, in ?
x
NameError: name 'x' is not defined
----------------------------------------------------------------------
@@ -539,7 +538,7 @@
Traceback (most recent call last):
File ".../doctest.py", line 1256, in __run
compileflags, 1) in test.globs
- File "<doctest sample2.sampletests_1.eek[2]>", line 1, in ?
+ File "<doctest sample2.sampletests_1.eek[line 7, example 2]>", line 1, in ?
z = x + 1
NameError: name 'x' is not defined
<BLANKLINE>
@@ -558,7 +557,7 @@
kinds.
>>> sys.argv = 'test --tests-pattern ^pledge$'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -598,7 +597,7 @@
caret marking the mismatching column positions.
>>> sys.argv = 'test --tests-pattern ^pledge$ --ndiff'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -626,7 +625,7 @@
The -udiff option requests a standard "unified" diff:
>>> sys.argv = 'test --tests-pattern ^pledge$ --udiff'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -653,7 +652,7 @@
The -cdiff option requests a standard "context" diff:
>>> sys.argv = 'test --tests-pattern ^pledge$ --cdiff'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -702,13 +701,12 @@
>>> sys.argv = ('test --tests-pattern ^sampletests(f|_i)?$ --layer 1 '
... ).split()
- >>> testrunner.run(defaults)
- ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
+ >>> testrunner.run_internal(defaults)
+ ... # doctest: +NORMALIZE_WHITESPACE
Test-module import failures:
<BLANKLINE>
Module: sample2.sampletests_i
<BLANKLINE>
- ...
File "testrunner-ex/sample2/sampletests_i.py", line 1
importx unittest
^
@@ -718,11 +716,9 @@
Module: sample2.sample21.sampletests_i
<BLANKLINE>
Traceback (most recent call last):
- ...
File "testrunner-ex/sample2/sample21/sampletests_i.py", line 15, in ?
import zope.testing.huh
- ...
- ImportError: No module named zope.testing.huh
+ ImportError: No module named huh
<BLANKLINE>
<BLANKLINE>
Module: sample2.sample22.sampletests_i
@@ -733,7 +729,6 @@
Module: sample2.sample23.sampletests_i
<BLANKLINE>
Traceback (most recent call last):
- ...
File "testrunner-ex/sample2/sample23/sampletests_i.py", line 18, in ?
class Test(unittest.TestCase):
File "testrunner-ex/sample2/sample23/sampletests_i.py", line 23, in Test
@@ -789,7 +784,7 @@
unicode and another not:
>>> sys.argv = 'test --tests-pattern ^unicode$ -u'.split()
- >>> testrunner.run(defaults) # doctest: +REPORT_NDIFF
+ >>> testrunner.run_internal(defaults) # doctest: +REPORT_NDIFF
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
@@ -820,18 +815,19 @@
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
True
-
+
Reporting Errors to Calling Processes
-------------------------------------
-The testrunner can return an error status, indicating that the tests
+The testrunner returns the error status, indicating that the tests
failed. This can be useful for an invoking process that wants to
monitor the result of a test run.
-To use, specify the argument "--exit-with-status".
+This is applied when invoking the testrunner using the ``run()`` function
+instead of ``run_internal()``:
>>> sys.argv = (
- ... 'test --exit-with-status --tests-pattern ^sampletests_1$'.split())
+ ... 'test --tests-pattern ^sampletests_1$'.split())
>>> try:
... testrunner.run(defaults)
... except SystemExit, e:
@@ -847,14 +843,14 @@
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
exited with code 1
-A passing test does not exit.
+Passing tests exit with code 0 according to UNIX practices:
>>> sys.argv = (
- ... 'test --exit-with-status --tests-pattern ^sampletests$'.split())
+ ... 'test --tests-pattern ^sampletests$'.split())
>>> try:
... testrunner.run(defaults)
... except SystemExit, e2:
- ... print 'oops'
+ ... print 'exited with code', e2.code
... else:
... print 'sys.exit was not called'
... # doctest: +ELLIPSIS
@@ -869,8 +865,7 @@
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Total: 364 tests, 0 failures, 0 errors in N.NNN seconds.
- ...
- sys.exit was not called
+ exited with code 0
And remove the temporary directory:
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_1.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_1.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_1.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -26,4 +26,4 @@
"""
def test_suite():
- return doctest.DocTestSuite()
+ return doctest.DocTestSuite(optionflags=doctest.REPORT_NDIFF)
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-gc.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-gc.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-gc.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -17,7 +17,7 @@
>>> from zope.testing import testrunner
>>> sys.argv = 'test --tests-pattern ^gc0$ --gc 0 -vv'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Cyclic garbage collection is disabled.
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
@@ -34,7 +34,7 @@
by providing a low threshold:
>>> sys.argv = 'test --tests-pattern ^gc1$ --gc 1 -vv'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Cyclic garbage collection threshold set to: (1,)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
@@ -51,7 +51,7 @@
>>> sys.argv = ('test --tests-pattern ^gcset$ --gc 701 --gc 11 --gc 9 -vv'
... .split())
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Cyclic garbage collection threshold set to: (701, 11, 9)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
@@ -79,7 +79,7 @@
>>> sys.argv = ('test --tests-pattern ^gcstats$ -G DEBUG_STATS'
... ' -G DEBUG_COLLECTABLE -vv'
... .split())
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-knit.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-knit.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-knit.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -41,7 +41,7 @@
>>> from zope.testing import testrunner
>>> sys.argv = 'test --layer Layer111 -vv'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer111 tests:
Set up samplelayers.Layerx in 0.000 seconds.
@@ -69,7 +69,7 @@
or individual packages within knit-in packages:
>>> sys.argv = 'test --package sample4.products -vv'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer111 tests:
Set up samplelayers.Layerx in 0.000 seconds.
@@ -87,7 +87,7 @@
Tear down samplelayers.Layer1 in 0.000 seconds.
>>> sys.argv = 'test --package sample4.products.more -vv'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer111 tests:
Set up samplelayers.Layerx in 0.000 seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-layers-ntd.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-layers-ntd.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-layers-ntd.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -14,7 +14,7 @@
... ]
>>> sys.argv = 'test -ssample2 --tests-pattern sampletests_ntd$'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running sample2.sampletests_ntd.Layer tests:
Set up sample2.sampletests_ntd.Layer in 0.000 seconds.
Ran 1 tests with 0 failures and 0 errors in 0.000 seconds.
@@ -27,7 +27,7 @@
resuming tests where it left off:
>>> sys.argv = [testrunner_script, '--tests-pattern', 'sampletests_ntd$']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running sample1.sampletests_ntd.Layer tests:
Set up sample1.sampletests_ntd.Layer in N.NNN seconds.
Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
@@ -85,7 +85,7 @@
>>> sys.argv = [testrunner_script, '--tests-pattern', 'sampletests_ntd$',
... '-D', ]
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running sample1.sampletests_ntd.Layer tests:
Set up sample1.sampletests_ntd.Layer in N.NNN seconds.
Ran 1 tests with 0 failures and 0 errors in N.NNN seconds.
@@ -159,7 +159,7 @@
that is run as a subprocess:
>>> sys.argv = [testrunner_script, '--tests-pattern', 'sampletests_ntds']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running sample1.sampletests_ntds.Layer tests:
Set up sample1.sampletests_ntds.Layer in 0.000 seconds.
Ran 1 tests with 0 failures and 0 errors in 0.000 seconds.
@@ -246,7 +246,7 @@
>>> sys.argv = [testrunner_script, '-s', 'sample2', '--tests-pattern',
... '(sampletests_ntd$|stderrtest)']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running sample2.sampletests_ntd.Layer tests:
Set up sample2.sampletests_ntd.Layer in 0.000 seconds.
Ran 1 tests with 0 failures and 0 errors in 0.000 seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-layers.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-layers.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-layers.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -12,7 +12,7 @@
>>> sys.argv = 'test --layer 112 --layer Unit'.split()
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer112 tests:
Set up samplelayers.Layerx in N.NNN seconds.
Set up samplelayers.Layer1 in N.NNN seconds.
@@ -35,7 +35,7 @@
We can also specify that we want to run only the unit tests:
>>> sys.argv = 'test -u'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Ran 192 tests with 0 failures and 0 errors in N.NNN seconds.
@@ -47,7 +47,7 @@
Or that we want to run all of the tests except for the unit tests:
>>> sys.argv = 'test -f'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer1 tests:
Set up samplelayers.Layer1 in N.NNN seconds.
Ran 9 tests with 0 failures and 0 errors in N.NNN seconds.
@@ -85,7 +85,7 @@
Or we can explicitly say that we want both unit and non-unit tests.
>>> sys.argv = 'test -uf'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer1 tests:
Set up samplelayers.Layer1 in N.NNN seconds.
Ran 9 tests with 0 failures and 0 errors in N.NNN seconds.
@@ -127,7 +127,7 @@
It is possible to force the layers to run in subprocesses and parallelize them.
>>> sys.argv = [testrunner_script, '-j2']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer1 tests:
Set up samplelayers.Layer1 in N.NNN seconds.
Ran 9 tests with 0 failures and 0 errors in N.NNN seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-leaks-err.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-leaks-err.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-leaks-err.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -15,7 +15,7 @@
>>> from zope.testing import testrunner
>>> sys.argv = 'test -r -N6'.split()
- >>> _ = testrunner.run(defaults)
+ >>> _ = testrunner.run_internal(defaults)
The Python you are running was not configured
with --with-pydebug. This is required to use
the --report-refcounts option.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-profiling-cprofiler.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-profiling-cprofiler.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-profiling-cprofiler.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -18,7 +18,7 @@
When the tests are run, we get profiling output::
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running...
...
ncalls tottime percall cumtime percall filename:lineno(function)...
@@ -28,7 +28,7 @@
>>> sys.argv = [testrunner_script, '-ssample2', '--profile=cProfile',
... '--tests-pattern', 'sampletests_ntd']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running...
Tear down ... not supported...
ncalls tottime percall cumtime percall filename:lineno(function)...
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-profiling.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-profiling.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-profiling.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -18,7 +18,7 @@
When the tests are run, we get profiling output.
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer1 tests:
...
Running samplelayers.Layer11 tests:
@@ -34,7 +34,7 @@
>>> sys.argv = [testrunner_script, '-ssample2', '--profile=hotshot',
... '--tests-pattern', 'sampletests_ntd']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running...
Tear down ... not supported...
ncalls tottime percall cumtime percall filename:lineno(function)...
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-progress.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-progress.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-progress.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -15,65 +15,64 @@
>>> sys.argv = 'test --layer 122 -p'.split()
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> 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.
Running:
- 1/34 (2.9%)\r
- \r
- 2/34 (5.9%)\r
- \r
- 3/34 (8.8%)\r
- \r
- 4/34 (11.8%)\r
- \r
- 5/34 (14.7%)\r
- \r
- 6/34 (17.6%)\r
- \r
- 7/34 (20.6%)\r
- \r
- 8/34 (23.5%)\r
- \r
- 9/34 (26.5%)\r
- \r
- 10/34 (29.4%)\r
- \r
- 11/34 (32.4%)\r
- \r
- 12/34 (35.3%)\r
- \r
- 17/34 (50.0%)\r
- \r
- 18/34 (52.9%)\r
- \r
- 19/34 (55.9%)\r
- \r
- 20/34 (58.8%)\r
- \r
- 21/34 (61.8%)\r
- \r
- 22/34 (64.7%)\r
- \r
- 23/34 (67.6%)\r
- \r
- 24/34 (70.6%)\r
- \r
- 25/34 (73.5%)\r
- \r
- 26/34 (76.5%)\r
- \r
- 27/34 (79.4%)\r
- \r
- 28/34 (82.4%)\r
- \r
- 29/34 (85.3%)\r
- \r
- 34/34 (100.0%)\r
- \r
- <BLANKLINE>
+ 1/34 (2.9%)##r##
+ ##r##
+ 2/34 (5.9%)##r##
+ ##r##
+ 3/34 (8.8%)##r##
+ ##r##
+ 4/34 (11.8%)##r##
+ ##r##
+ 5/34 (14.7%)##r##
+ ##r##
+ 6/34 (17.6%)##r##
+ ##r##
+ 7/34 (20.6%)##r##
+ ##r##
+ 8/34 (23.5%)##r##
+ ##r##
+ 9/34 (26.5%)##r##
+ ##r##
+ 10/34 (29.4%)##r##
+ ##r##
+ 11/34 (32.4%)##r##
+ ##r##
+ 12/34 (35.3%)##r##
+ ##r##
+ 17/34 (50.0%)##r##
+ ##r##
+ 18/34 (52.9%)##r##
+ ##r##
+ 19/34 (55.9%)##r##
+ ##r##
+ 20/34 (58.8%)##r##
+ ##r##
+ 21/34 (61.8%)##r##
+ ##r##
+ 22/34 (64.7%)##r##
+ ##r##
+ 23/34 (67.6%)##r##
+ ##r##
+ 24/34 (70.6%)##r##
+ ##r##
+ 25/34 (73.5%)##r##
+ ##r##
+ 26/34 (76.5%)##r##
+ ##r##
+ 27/34 (79.4%)##r##
+ ##r##
+ 28/34 (82.4%)##r##
+ ##r##
+ 29/34 (85.3%)##r##
+ ##r##
+ 34/34 (100.0%)##r##
+ ##r##
Ran 34 tests with 0 failures and 0 errors in 0.008 seconds.
Tearing down left over layers:
Tear down samplelayers.Layer122 in 0.000 seconds.
@@ -81,7 +80,7 @@
Tear down samplelayers.Layer1 in 0.000 seconds.
False
-(Note that, in the examples above and below, we show "\r" followed by
+(Note that, in the examples above and below, we show "##r##" followed by
new lines where carriage returns would appear in actual output.)
Using a single level of verbosity causes test descriptions to be
@@ -89,66 +88,65 @@
width, when the terminal width can't be determined, is 80:
>>> sys.argv = 'test --layer 122 -pv'.split()
->>> testrunner.run(defaults)
+>>> 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/34 (2.9%) test_x1 (sample1.sampletests.test122.TestA)\r
- \r
- 2/34 (5.9%) test_y0 (sample1.sampletests.test122.TestA)\r
- \r
- 3/34 (8.8%) test_z0 (sample1.sampletests.test122.TestA)\r
- \r
- 4/34 (11.8%) test_x0 (sample1.sampletests.test122.TestB)\r
- \r
- 5/34 (14.7%) test_y1 (sample1.sampletests.test122.TestB)\r
- \r
- 6/34 (17.6%) test_z0 (sample1.sampletests.test122.TestB)\r
- \r
- 7/34 (20.6%) test_1 (sample1.sampletests.test122.TestNotMuch)\r
- \r
- 8/34 (23.5%) test_2 (sample1.sampletests.test122.TestNotMuch)\r
- \r
- 9/34 (26.5%) test_3 (sample1.sampletests.test122.TestNotMuch)\r
- \r
- 10/34 (29.4%) test_x0 (sample1.sampletests.test122)\r
- \r
- 11/34 (32.4%) test_y0 (sample1.sampletests.test122)\r
- \r
- 12/34 (35.3%) test_z1 (sample1.sampletests.test122)\r
- \r
- 17/34 (50.0%) ... /testrunner-ex/sample1/sampletests/../../sampletestsl.txt\r
- \r
- 18/34 (52.9%) test_x1 (sampletests.test122.TestA)\r
- \r
- 19/34 (55.9%) test_y0 (sampletests.test122.TestA)\r
- \r
- 20/34 (58.8%) test_z0 (sampletests.test122.TestA)\r
- \r
- 21/34 (61.8%) test_x0 (sampletests.test122.TestB)\r
- \r
- 22/34 (64.7%) test_y1 (sampletests.test122.TestB)\r
- \r
- 23/34 (67.6%) test_z0 (sampletests.test122.TestB)\r
- \r
- 24/34 (70.6%) test_1 (sampletests.test122.TestNotMuch)\r
- \r
- 25/34 (73.5%) test_2 (sampletests.test122.TestNotMuch)\r
- \r
- 26/34 (76.5%) test_3 (sampletests.test122.TestNotMuch)\r
- \r
- 27/34 (79.4%) test_x0 (sampletests.test122)\r
- \r
- 28/34 (82.4%) test_y0 (sampletests.test122)\r
- \r
- 29/34 (85.3%) test_z1 (sampletests.test122)\r
- \r
- 34/34 (100.0%) ... pe/testing/testrunner-ex/sampletests/../sampletestsl.txt\r
- \r
-<BLANKLINE>
+ 1/34 (2.9%) test_x1 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 2/34 (5.9%) test_y0 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 3/34 (8.8%) test_z0 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 4/34 (11.8%) test_x0 (sample1.sampletests.test122.TestB)##r##
+ ##r##
+ 5/34 (14.7%) test_y1 (sample1.sampletests.test122.TestB)##r##
+ ##r##
+ 6/34 (17.6%) test_z0 (sample1.sampletests.test122.TestB)##r##
+ ##r##
+ 7/34 (20.6%) test_1 (sample1.sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 8/34 (23.5%) test_2 (sample1.sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 9/34 (26.5%) test_3 (sample1.sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 10/34 (29.4%) test_x0 (sample1.sampletests.test122)##r##
+ ##r##
+ 11/34 (32.4%) test_y0 (sample1.sampletests.test122)##r##
+ ##r##
+ 12/34 (35.3%) test_z1 (sample1.sampletests.test122)##r##
+ ##r##
+ 17/34 (50.0%) ... /testrunner-ex/sample1/sampletests/../../sampletestsl.txt##r##
+ ##r##
+ 18/34 (52.9%) test_x1 (sampletests.test122.TestA)##r##
+ ##r##
+ 19/34 (55.9%) test_y0 (sampletests.test122.TestA)##r##
+ ##r##
+ 20/34 (58.8%) test_z0 (sampletests.test122.TestA)##r##
+ ##r##
+ 21/34 (61.8%) test_x0 (sampletests.test122.TestB)##r##
+ ##r##
+ 22/34 (64.7%) test_y1 (sampletests.test122.TestB)##r##
+ ##r##
+ 23/34 (67.6%) test_z0 (sampletests.test122.TestB)##r##
+ ##r##
+ 24/34 (70.6%) test_1 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 25/34 (73.5%) test_2 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 26/34 (76.5%) test_3 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 27/34 (79.4%) test_x0 (sampletests.test122)##r##
+ ##r##
+ 28/34 (82.4%) test_y0 (sampletests.test122)##r##
+ ##r##
+ 29/34 (85.3%) test_z1 (sampletests.test122)##r##
+ ##r##
+ 34/34 (100.0%) ... pe/testing/testrunner-ex/sampletests/../sampletestsl.txt##r##
+ ##r##
Ran 34 tests with 0 failures and 0 errors in 0.008 seconds.
Tearing down left over layers:
Tear down samplelayers.Layer122 in 0.000 seconds.
@@ -166,66 +164,65 @@
... return 60
>>> old_curses = sys.modules.get('curses')
>>> sys.modules['curses'] = FakeCurses()
- >>> testrunner.run(defaults)
+ >>> 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/34 (2.9%) test_x1 (sample1.sampletests.test122.TestA)\r
- \r
- 2/34 (5.9%) test_y0 (sample1.sampletests.test122.TestA)\r
- \r
- 3/34 (8.8%) test_z0 (sample1.sampletests.test122.TestA)\r
- \r
- 4/34 (11.8%) test_x0 (...le1.sampletests.test122.TestB)\r
- \r
- 5/34 (14.7%) test_y1 (...le1.sampletests.test122.TestB)\r
- \r
- 6/34 (17.6%) test_z0 (...le1.sampletests.test122.TestB)\r
- \r
- 7/34 (20.6%) test_1 (...ampletests.test122.TestNotMuch)\r
- \r
- 8/34 (23.5%) test_2 (...ampletests.test122.TestNotMuch)\r
- \r
- 9/34 (26.5%) test_3 (...ampletests.test122.TestNotMuch)\r
- \r
- 10/34 (29.4%) test_x0 (sample1.sampletests.test122)\r
- \r
- 11/34 (32.4%) test_y0 (sample1.sampletests.test122)\r
- \r
- 12/34 (35.3%) test_z1 (sample1.sampletests.test122)\r
- \r
- 17/34 (50.0%) ... e1/sampletests/../../sampletestsl.txt\r
- \r
- 18/34 (52.9%) test_x1 (sampletests.test122.TestA)\r
- \r
- 19/34 (55.9%) test_y0 (sampletests.test122.TestA)\r
- \r
- 20/34 (58.8%) test_z0 (sampletests.test122.TestA)\r
- \r
- 21/34 (61.8%) test_x0 (sampletests.test122.TestB)\r
- \r
- 22/34 (64.7%) test_y1 (sampletests.test122.TestB)\r
- \r
- 23/34 (67.6%) test_z0 (sampletests.test122.TestB)\r
- \r
- 24/34 (70.6%) test_1 (sampletests.test122.TestNotMuch)\r
- \r
- 25/34 (73.5%) test_2 (sampletests.test122.TestNotMuch)\r
- \r
- 26/34 (76.5%) test_3 (sampletests.test122.TestNotMuch)\r
- \r
- 27/34 (79.4%) test_x0 (sampletests.test122)\r
- \r
- 28/34 (82.4%) test_y0 (sampletests.test122)\r
- \r
- 29/34 (85.3%) test_z1 (sampletests.test122)\r
- \r
- 34/34 (100.0%) ... r-ex/sampletests/../sampletestsl.txt\r
- \r
- <BLANKLINE>
+ 1/34 (2.9%) test_x1 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 2/34 (5.9%) test_y0 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 3/34 (8.8%) test_z0 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 4/34 (11.8%) test_x0 (...le1.sampletests.test122.TestB)##r##
+ ##r##
+ 5/34 (14.7%) test_y1 (...le1.sampletests.test122.TestB)##r##
+ ##r##
+ 6/34 (17.6%) test_z0 (...le1.sampletests.test122.TestB)##r##
+ ##r##
+ 7/34 (20.6%) test_1 (...ampletests.test122.TestNotMuch)##r##
+ ##r##
+ 8/34 (23.5%) test_2 (...ampletests.test122.TestNotMuch)##r##
+ ##r##
+ 9/34 (26.5%) test_3 (...ampletests.test122.TestNotMuch)##r##
+ ##r##
+ 10/34 (29.4%) test_x0 (sample1.sampletests.test122)##r##
+ ##r##
+ 11/34 (32.4%) test_y0 (sample1.sampletests.test122)##r##
+ ##r##
+ 12/34 (35.3%) test_z1 (sample1.sampletests.test122)##r##
+ ##r##
+ 17/34 (50.0%) ... e1/sampletests/../../sampletestsl.txt##r##
+ ##r##
+ 18/34 (52.9%) test_x1 (sampletests.test122.TestA)##r##
+ ##r##
+ 19/34 (55.9%) test_y0 (sampletests.test122.TestA)##r##
+ ##r##
+ 20/34 (58.8%) test_z0 (sampletests.test122.TestA)##r##
+ ##r##
+ 21/34 (61.8%) test_x0 (sampletests.test122.TestB)##r##
+ ##r##
+ 22/34 (64.7%) test_y1 (sampletests.test122.TestB)##r##
+ ##r##
+ 23/34 (67.6%) test_z0 (sampletests.test122.TestB)##r##
+ ##r##
+ 24/34 (70.6%) test_1 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 25/34 (73.5%) test_2 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 26/34 (76.5%) test_3 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 27/34 (79.4%) test_x0 (sampletests.test122)##r##
+ ##r##
+ 28/34 (82.4%) test_y0 (sampletests.test122)##r##
+ ##r##
+ 29/34 (85.3%) test_z1 (sampletests.test122)##r##
+ ##r##
+ 34/34 (100.0%) ... r-ex/sampletests/../sampletestsl.txt##r##
+ ##r##
Ran 34 tests with 0 failures and 0 errors in 0.008 seconds.
Tearing down left over layers:
Tear down samplelayers.Layer122 in 0.000 seconds.
@@ -239,62 +236,61 @@
information.
>>> sys.argv = 'test --layer 122 -pvv -t !txt'.split()
- >>> testrunner.run(defaults)
+ >>> 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/24 (4.2%) test_x1 (sample1.sampletests.test122.TestA)\r
- \r
- 2/24 (8.3%) test_y0 (sample1.sampletests.test122.TestA)\r
- \r
- 3/24 (12.5%) test_z0 (sample1.sampletests.test122.TestA)\r
- \r
- 4/24 (16.7%) test_x0 (sample1.sampletests.test122.TestB)\r
- \r
- 5/24 (20.8%) test_y1 (sample1.sampletests.test122.TestB)\r
- \r
- 6/24 (25.0%) test_z0 (sample1.sampletests.test122.TestB)\r
- \r
- 7/24 (29.2%) test_1 (sample1.sampletests.test122.TestNotMuch)\r
- \r
- 8/24 (33.3%) test_2 (sample1.sampletests.test122.TestNotMuch)\r
- \r
- 9/24 (37.5%) test_3 (sample1.sampletests.test122.TestNotMuch)\r
- \r
- 10/24 (41.7%) test_x0 (sample1.sampletests.test122)\r
- \r
- 11/24 (45.8%) test_y0 (sample1.sampletests.test122)\r
- \r
- 12/24 (50.0%) test_z1 (sample1.sampletests.test122)\r
- \r
- 13/24 (54.2%) test_x1 (sampletests.test122.TestA)\r
- \r
- 14/24 (58.3%) test_y0 (sampletests.test122.TestA)\r
- \r
- 15/24 (62.5%) test_z0 (sampletests.test122.TestA)\r
- \r
- 16/24 (66.7%) test_x0 (sampletests.test122.TestB)\r
- \r
- 17/24 (70.8%) test_y1 (sampletests.test122.TestB)\r
- \r
- 18/24 (75.0%) test_z0 (sampletests.test122.TestB)\r
- \r
- 19/24 (79.2%) test_1 (sampletests.test122.TestNotMuch)\r
- \r
- 20/24 (83.3%) test_2 (sampletests.test122.TestNotMuch)\r
- \r
- 21/24 (87.5%) test_3 (sampletests.test122.TestNotMuch)\r
- \r
- 22/24 (91.7%) test_x0 (sampletests.test122)\r
- \r
- 23/24 (95.8%) test_y0 (sampletests.test122)\r
- \r
- 24/24 (100.0%) test_z1 (sampletests.test122)\r
- \r
- <BLANKLINE>
+ 1/24 (4.2%) test_x1 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 2/24 (8.3%) test_y0 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 3/24 (12.5%) test_z0 (sample1.sampletests.test122.TestA)##r##
+ ##r##
+ 4/24 (16.7%) test_x0 (sample1.sampletests.test122.TestB)##r##
+ ##r##
+ 5/24 (20.8%) test_y1 (sample1.sampletests.test122.TestB)##r##
+ ##r##
+ 6/24 (25.0%) test_z0 (sample1.sampletests.test122.TestB)##r##
+ ##r##
+ 7/24 (29.2%) test_1 (sample1.sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 8/24 (33.3%) test_2 (sample1.sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 9/24 (37.5%) test_3 (sample1.sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 10/24 (41.7%) test_x0 (sample1.sampletests.test122)##r##
+ ##r##
+ 11/24 (45.8%) test_y0 (sample1.sampletests.test122)##r##
+ ##r##
+ 12/24 (50.0%) test_z1 (sample1.sampletests.test122)##r##
+ ##r##
+ 13/24 (54.2%) test_x1 (sampletests.test122.TestA)##r##
+ ##r##
+ 14/24 (58.3%) test_y0 (sampletests.test122.TestA)##r##
+ ##r##
+ 15/24 (62.5%) test_z0 (sampletests.test122.TestA)##r##
+ ##r##
+ 16/24 (66.7%) test_x0 (sampletests.test122.TestB)##r##
+ ##r##
+ 17/24 (70.8%) test_y1 (sampletests.test122.TestB)##r##
+ ##r##
+ 18/24 (75.0%) test_z0 (sampletests.test122.TestB)##r##
+ ##r##
+ 19/24 (79.2%) test_1 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 20/24 (83.3%) test_2 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 21/24 (87.5%) test_3 (sampletests.test122.TestNotMuch)##r##
+ ##r##
+ 22/24 (91.7%) test_x0 (sampletests.test122)##r##
+ ##r##
+ 23/24 (95.8%) test_y0 (sampletests.test122)##r##
+ ##r##
+ 24/24 (100.0%) test_z1 (sampletests.test122)##r##
+ ##r##
Ran 24 tests with 0 failures and 0 errors in 0.006 seconds.
Tearing down left over layers:
Tear down samplelayers.Layer122 in 0.000 seconds.
@@ -306,50 +302,49 @@
with '!' to exclude tests containing the string "txt".
>>> sys.argv = 'test --layer 122 -pvvv -t!(txt|NotMuch)'.split()
- >>> testrunner.run(defaults)
+ >>> 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/18 (5.6%) test_x1 (sample1.sampletests.test122.TestA) (0.000 s)\r
- \r
- 2/18 (11.1%) test_y0 (sample1.sampletests.test122.TestA) (0.000 s)\r
- \r
- 3/18 (16.7%) test_z0 (sample1.sampletests.test122.TestA) (0.000 s)\r
- \r
- 4/18 (22.2%) test_x0 (sample1.sampletests.test122.TestB) (0.000 s)\r
- \r
- 5/18 (27.8%) test_y1 (sample1.sampletests.test122.TestB) (0.000 s)\r
- \r
- 6/18 (33.3%) test_z0 (sample1.sampletests.test122.TestB) (0.000 s)\r
- \r
- 7/18 (38.9%) test_x0 (sample1.sampletests.test122) (0.001 s)\r
- \r
- 8/18 (44.4%) test_y0 (sample1.sampletests.test122) (0.001 s)\r
- \r
- 9/18 (50.0%) test_z1 (sample1.sampletests.test122) (0.001 s)\r
- \r
- 10/18 (55.6%) test_x1 (sampletests.test122.TestA) (0.000 s)\r
- \r
- 11/18 (61.1%) test_y0 (sampletests.test122.TestA) (0.000 s)\r
- \r
- 12/18 (66.7%) test_z0 (sampletests.test122.TestA) (0.000 s)\r
- \r
- 13/18 (72.2%) test_x0 (sampletests.test122.TestB) (0.000 s)\r
- \r
- 14/18 (77.8%) test_y1 (sampletests.test122.TestB) (0.000 s)\r
- \r
- 15/18 (83.3%) test_z0 (sampletests.test122.TestB) (0.000 s)\r
- \r
- 16/18 (88.9%) test_x0 (sampletests.test122) (0.001 s)\r
- \r
- 17/18 (94.4%) test_y0 (sampletests.test122) (0.001 s)\r
- \r
- 18/18 (100.0%) test_z1 (sampletests.test122) (0.001 s)\r
- \r
- <BLANKLINE>
+ 1/18 (5.6%) test_x1 (sample1.sampletests.test122.TestA) (0.000 s)##r##
+ ##r##
+ 2/18 (11.1%) test_y0 (sample1.sampletests.test122.TestA) (0.000 s)##r##
+ ##r##
+ 3/18 (16.7%) test_z0 (sample1.sampletests.test122.TestA) (0.000 s)##r##
+ ##r##
+ 4/18 (22.2%) test_x0 (sample1.sampletests.test122.TestB) (0.000 s)##r##
+ ##r##
+ 5/18 (27.8%) test_y1 (sample1.sampletests.test122.TestB) (0.000 s)##r##
+ ##r##
+ 6/18 (33.3%) test_z0 (sample1.sampletests.test122.TestB) (0.000 s)##r##
+ ##r##
+ 7/18 (38.9%) test_x0 (sample1.sampletests.test122) (0.001 s)##r##
+ ##r##
+ 8/18 (44.4%) test_y0 (sample1.sampletests.test122) (0.001 s)##r##
+ ##r##
+ 9/18 (50.0%) test_z1 (sample1.sampletests.test122) (0.001 s)##r##
+ ##r##
+ 10/18 (55.6%) test_x1 (sampletests.test122.TestA) (0.000 s)##r##
+ ##r##
+ 11/18 (61.1%) test_y0 (sampletests.test122.TestA) (0.000 s)##r##
+ ##r##
+ 12/18 (66.7%) test_z0 (sampletests.test122.TestA) (0.000 s)##r##
+ ##r##
+ 13/18 (72.2%) test_x0 (sampletests.test122.TestB) (0.000 s)##r##
+ ##r##
+ 14/18 (77.8%) test_y1 (sampletests.test122.TestB) (0.000 s)##r##
+ ##r##
+ 15/18 (83.3%) test_z0 (sampletests.test122.TestB) (0.000 s)##r##
+ ##r##
+ 16/18 (88.9%) test_x0 (sampletests.test122) (0.001 s)##r##
+ ##r##
+ 17/18 (94.4%) test_y0 (sampletests.test122) (0.001 s)##r##
+ ##r##
+ 18/18 (100.0%) test_z1 (sampletests.test122) (0.001 s)##r##
+ ##r##
Ran 18 tests with 0 failures and 0 errors in 0.006 seconds.
Tearing down left over layers:
Tear down samplelayers.Layer122 in 0.000 seconds.
@@ -383,23 +378,22 @@
>>> sys.stdout = Terminal(sys.stdout)
>>> sys.argv = 'test -u -t test_one.TestNotMuch --auto-progress'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Running:
- 1/6 (16.7%)\r
- \r
- 2/6 (33.3%)\r
- \r
- 3/6 (50.0%)\r
- \r
- 4/6 (66.7%)\r
- \r
- 5/6 (83.3%)\r
- \r
- 6/6 (100.0%)\r
- \r
- <BLANKLINE>
+ 1/6 (16.7%)##r##
+ ##r##
+ 2/6 (33.3%)##r##
+ ##r##
+ 3/6 (50.0%)##r##
+ ##r##
+ 4/6 (66.7%)##r##
+ ##r##
+ 5/6 (83.3%)##r##
+ ##r##
+ 6/6 (100.0%)##r##
+ ##r##
Ran 6 tests with 0 failures and 0 errors in N.NNN seconds.
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -411,7 +405,7 @@
>>> sys.stdout = real_stdout
>>> sys.argv = 'test -u -t test_one.TestNotMuch --auto-progress'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Ran 6 tests with 0 failures and 0 errors in N.NNN seconds.
@@ -428,13 +422,10 @@
--no-progress:
>>> sys.argv = 'test -u -t test_one.TestNotMuch -p --no-progress'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Ran 6 tests with 0 failures and 0 errors in N.NNN seconds.
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
False
-
-
-
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-repeat.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-repeat.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-repeat.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -14,7 +14,7 @@
>>> sys.argv = 'test --layer 112 --layer UnitTests --repeat 3'.split()
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer112 tests:
Set up samplelayers.Layerx in 0.000 seconds.
Set up samplelayers.Layer1 in 0.000 seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-simple.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-simple.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-simple.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -46,7 +46,7 @@
>>> from zope.testing import testrunner
>>> import sys
>>> sys.argv = ['test']
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running samplelayers.Layer1 tests:
Set up samplelayers.Layer1 in N.NNN seconds.
Ran 9 tests with 0 failures and 0 errors in N.NNN seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-test-selection.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-test-selection.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-test-selection.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -13,7 +13,7 @@
>>> sys.argv = 'test --layer 122 -ssample1 -vv'.split()
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
@@ -43,7 +43,7 @@
You can specify multiple packages:
>>> sys.argv = 'test -u -vv -ssample1 -ssample2'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -163,7 +163,7 @@
>>> subdir = os.path.join(directory_with_tests, 'sample1')
>>> sys.argv = ('test --layer 122 -s %s -vv' % subdir).split()
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
@@ -193,7 +193,7 @@
We can select by test module name using the --module (-m) option:
>>> sys.argv = 'test -u -vv -ssample1 -m_one -mtest1'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -233,7 +233,7 @@
and by test within the module using the --test (-t) option:
>>> sys.argv = 'test -u -vv -ssample1 -m_one -mtest1 -tx0 -ty0'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -253,7 +253,7 @@
>>> sys.argv = 'test -u -vv -ssample1 -ttxt'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -274,7 +274,7 @@
match the regular expression are selected:
>>> sys.argv = 'test -u -vv -ssample1 -m!sample1[.]sample1'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -328,7 +328,7 @@
>>> sys.argv = 'test -u -vv -ssample1 !sample1[.]sample1'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -379,7 +379,7 @@
>>> sys.argv = 'test -u -vv -ssample1 . txt'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -403,7 +403,7 @@
>>> sys.argv = 'test -u -vv -t test_y1 -t test_y0'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -454,7 +454,7 @@
additional tests:
>>> sys.argv = 'test -u -vv -a 2 -t test_y1 -t test_y0'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 2
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -506,7 +506,7 @@
We can use the --all option to run tests at all levels:
>>> sys.argv = 'test -u -vv --all -t test_y1 -t test_y0'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at all levels
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -564,7 +564,7 @@
specifications.
>>> sys.argv = 'test --all -m sample1 -t test_y0 --list-tests'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Listing samplelayers.Layer11 tests:
test_y0 (sample1.sampletests.test11.TestA)
test_y0 (sample1.sampletests.test11)
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-verbose.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-verbose.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-verbose.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -15,7 +15,7 @@
... ]
>>> sys.argv = 'test --layer 122 -v'.split()
>>> from zope.testing import testrunner
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
@@ -34,7 +34,7 @@
50:
>>> sys.argv = 'test -uv'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -49,7 +49,7 @@
each test is printed as it is run:
>>> sys.argv = 'test --layer 122 -vv'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
@@ -93,7 +93,7 @@
test-execution times are printed:
>>> sys.argv = 'test --layer 122 -vvv'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running tests at level 1
Running samplelayers.Layer122 tests:
Set up samplelayers.Layer1 in 0.000 seconds.
@@ -145,7 +145,7 @@
... '-v'
... ]
>>> sys.argv = 'test -q -u'.split()
- >>> testrunner.run(defaults)
+ >>> testrunner.run_internal(defaults)
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Ran 192 tests with 0 failures and 0 errors in 0.034 seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-wo-source.txt
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-wo-source.txt 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/testrunner-wo-source.txt 2009-07-03 15:40:55 UTC (rev 101461)
@@ -42,7 +42,7 @@
... '-vv',
... ]
>>> sys.argv = ['test']
- >>> testrunner.run(mydefaults)
+ >>> testrunner.run_internal(mydefaults)
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
@@ -66,7 +66,7 @@
... for f in files:
... if f.endswith(".py"):
... os.remove(os.path.join(root, f))
- >>> testrunner.run(mydefaults, ["test", "--keepbytecode"])
+ >>> testrunner.run_internal(mydefaults, ["test", "--keepbytecode"])
Running tests at level 1
Total: 0 tests, 0 failures, 0 errors in N.NNN seconds.
False
@@ -77,7 +77,7 @@
of "removing stale bytecode ..." messages shows that ``--usecompiled``
also implies ``--keepbytecode``:
- >>> testrunner.run(mydefaults, ["test", "--usecompiled"])
+ >>> testrunner.run_internal(mydefaults, ["test", "--usecompiled"])
Running tests at level 1
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/tests.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/tests.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/testrunner/tests.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -26,45 +26,103 @@
from zope.testing import renormalizing
-checker = renormalizing.RENormalizing([
- # 2.5 changed the way pdb reports exceptions
- (re.compile(r"<class 'exceptions.(\w+)Error'>:"),
- r'exceptions.\1Error:'),
+#separated checkers for the different platform,
+#because it s...s to maintain just one
+if sys.platform == 'win32':
+ checker = renormalizing.RENormalizing([
+ # 2.5 changed the way pdb reports exceptions
+ (re.compile(r"<class 'exceptions.(\w+)Error'>:"),
+ r'exceptions.\1Error:'),
- (re.compile('^> [^\n]+->None$', re.M), '> ...->None'),
- (re.compile(r"<module>"),(r'?')),
- (re.compile(r"<type 'exceptions.(\w+)Error'>:"),
- r'exceptions.\1Error:'),
- (re.compile("'[A-Za-z]:\\\\"), "'"), # hopefully, we'll make Windows happy
- (re.compile(r'\\\\'), '/'), # more Windows happiness
- (re.compile(r'\\'), '/'), # even more Windows happiness
- (re.compile('/r'), '\\\\r'), # undo damage from previous
- (re.compile(r'\r'), '\\\\r\n'),
- (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('( |")[^\n]+testrunner-ex'), r'\1testrunner-ex'),
- (re.compile('( |")[^\n]+testrunner.py'), r'\1testrunner.py'),
- (re.compile(r'> [^\n]*(doc|unit)test[.]py\(\d+\)'),
- r'\1test.py(NNN)'),
- (re.compile(r'[.]py\(\d+\)'), r'.py(NNN)'),
- (re.compile(r'[.]py:\d+'), r'.py:NNN'),
- (re.compile(r' line \d+,', re.IGNORECASE), r' Line NNN,'),
- (re.compile(r' line {([a-z]+)}\d+{', re.IGNORECASE), r' Line {\1}NNN{'),
+ #rewrite pdb prompt to ... the current location
+ #windows, py2.4 pdb seems not to put the '>' on doctest locations
+ #therefore we cut it here
+ (re.compile('^> doctest[^\n]+->None$', re.M), '...->None'),
- # omit traceback entries for unittest.py or doctest.py from
- # output:
- (re.compile(r'^ +File "[^\n]*(doc|unit)test.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.MULTILINE),
- r''),
- (re.compile('^> [^\n]+->None$', re.M), '> ...->None'),
- (re.compile('import pdb; pdb'), 'Pdb()'), # Py 2.3
- ])
+ #rewrite pdb prompt to ... the current location
+ (re.compile('^> [^\n]+->None$', re.M), '> ...->None'),
+ (re.compile(r"<module>"),(r'?')),
+ (re.compile(r"<type 'exceptions.(\w+)Error'>:"),
+ r'exceptions.\1Error:'),
+ (re.compile("'[A-Za-z]:\\\\"), "'"), # hopefully, we'll make Windows happy
+ # replaces drives with nothing
+
+ (re.compile(r'\\\\'), '/'), # more Windows happiness
+ # double backslashes in coverage???
+
+ (re.compile(r'\\'), '/'), # even more Windows happiness
+ # replaces backslashes in paths
+
+ #this is a magic to put linefeeds into the doctest
+ (re.compile('##r##\n'), '\r'),
+
+ (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('( |")[^\n]+testrunner-ex'), r'\1testrunner-ex'),
+ (re.compile('( |")[^\n]+testrunner.py'), r'\1testrunner.py'),
+ (re.compile(r'> [^\n]*(doc|unit)test[.]py\(\d+\)'),
+ r'\1test.py(NNN)'),
+ (re.compile(r'[.]py\(\d+\)'), r'.py(NNN)'),
+ (re.compile(r'[.]py:\d+'), r'.py:NNN'),
+ (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',
+ re.MULTILINE),
+ r''),
+ (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doc|unit)test.py{\w+}", [^\n]+\n[^\n]+\n',
+ re.MULTILINE),
+ r''),
+ #(re.compile('^> [^\n]+->None$', re.M), '> ...->None'),
+ (re.compile('import pdb; pdb'), 'Pdb()'), # Py 2.3
+ ])
+else:
+ #*nix
+ checker = renormalizing.RENormalizing([
+ # 2.5 changed the way pdb reports exceptions
+ (re.compile(r"<class 'exceptions.(\w+)Error'>:"),
+ r'exceptions.\1Error:'),
+
+ #rewrite pdb prompt to ... the current location
+ (re.compile('^> [^\n]+->None$', re.M), '> ...->None'),
+
+ (re.compile(r"<module>"),(r'?')),
+ (re.compile(r"<type 'exceptions.(\w+)Error'>:"),
+ r'exceptions.\1Error:'),
+
+ #this is a magic to put linefeeds into the doctest
+ #on win it takes one step, linux is crazy about the same...
+ (re.compile('##r##'), r'\r'),
+ (re.compile(r'\r'), '\\\\r\n'),
+
+ (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('( |")[^\n]+testrunner-ex'), r'\1testrunner-ex'),
+ (re.compile('( |")[^\n]+testrunner.py'), r'\1testrunner.py'),
+ (re.compile(r'> [^\n]*(doc|unit)test[.]py\(\d+\)'),
+ r'\1test.py(NNN)'),
+ (re.compile(r'[.]py\(\d+\)'), r'.py(NNN)'),
+ (re.compile(r'[.]py:\d+'), r'.py:NNN'),
+ (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',
+ re.MULTILINE),
+ r''),
+ (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doc|unit)test.py{\w+}", [^\n]+\n[^\n]+\n',
+ re.MULTILINE),
+ r''),
+ (re.compile('import pdb; pdb'), 'Pdb()'), # Py 2.3
+ ])
+
def setUp(test):
test.globs['saved-sys-info'] = (
sys.path[:],
@@ -104,12 +162,12 @@
'testrunner-repeat.txt',
'testrunner-gc.txt',
'testrunner-knit.txt',
- 'importcheck.txt',
setUp=setUp, tearDown=tearDown,
optionflags=doctest.ELLIPSIS+doctest.NORMALIZE_WHITESPACE,
checker=checker),
doctest.DocTestSuite('zope.testing.testrunner'),
- doctest.DocTestSuite('zope.testing.testrunner.coverage'),
+ doctest.DocTestSuite('zope.testing.testrunner.coverage',
+ optionflags=doctest.ELLIPSIS+doctest.NORMALIZE_WHITESPACE),
doctest.DocTestSuite('zope.testing.testrunner.options'),
doctest.DocTestSuite('zope.testing.testrunner.find'),
]
Modified: zope.testing/branches/ctheune-importchecking/src/zope/testing/tests.py
===================================================================
--- zope.testing/branches/ctheune-importchecking/src/zope/testing/tests.py 2009-07-03 15:38:58 UTC (rev 101460)
+++ zope.testing/branches/ctheune-importchecking/src/zope/testing/tests.py 2009-07-03 15:40:55 UTC (rev 101461)
@@ -17,9 +17,10 @@
"""
import os
+import re
import sys
import unittest
-from zope.testing import doctest, testrunner
+from zope.testing import doctest, testrunner, renormalizing
def test_suite():
return unittest.TestSuite((
@@ -28,6 +29,15 @@
doctest.DocTestSuite('zope.testing.server'),
doctest.DocFileSuite('doctest.txt'),
doctest.DocFileSuite('formparser.txt'),
- doctest.DocFileSuite('module.txt'),
+ doctest.DocFileSuite(
+ 'module.txt',
+ # when this test is run in isolation, the error message shows the
+ # module name as fully qualified; when it is run as part of the
+ # full test suite, the error message shows the module name as
+ # relative.
+ checker=renormalizing.RENormalizing([
+ (re.compile('No module named zope.testing.unlikelymodulename'),
+ 'No module named unlikelymodulename')])),
doctest.DocFileSuite('setupstack.txt'),
+ doctest.DocTestSuite(doctest, optionflags=doctest.INTERPRET_FOOTNOTES),
))
More information about the Zope3-Checkins
mailing list