Test Runner Comparison
testrunner.py |
test.py |
|
---|---|---|
History |
Part of the Zope distribution until version 2.7.1. Support was dropped because it would not run Zope's own unit tests anymore. There is an up-to-date version of testrunner.py at the URL below. |
Part of the Zope distribution since version 2.7.0. Originally a backport of the Z3 testrunner of the same name. |
URL | http://zope.org/Members/shh/TestRunner | http://cvs.zope.org/Zope/test.py |
Installs to | $ZOPE_HOME/bin/testrunner.py | $ZOPE_HOME/bin/test.py |
Usage | TestRunner Help | See the test.py docstring. |
Runs Zope's unit tests | no | yes |
Runs tests in instance homes | yes | yes |
Follows symbolic links | yes | yes |
Reads zope.conf files | yes | yes |
Runs entire test suites | yes | yes |
Runs individual test modules | yes | yes |
Runs individual test methods | no | yes |
Locates tests by |
From the given start directory, recursively searches all directories
for files matching the shell pattern If instead of a directory a file name is specified, only tests from this module will be imported and run. |
From the given start directory, recursively searches for Python packages
named If modulefilter or testfilter arguments have been passed, only tests matching these patterns will be collected and run. Note that test.py prepends the start directory to the PYTHONPATH. [2] |
Ignores |
|
|
Caveats |
Due to the way it collects tests, testrunner.py is not well suited for running giant, interdependent test suites; like Zope's. |
Adds the start directory to the beginning of sys.path so it can import the test modules. [2]
The option to "remove stale bytecode" is enabled by default.
You may want to add the |
Examples |
Running Zope Unit Tests cd $ZOPE_HOME python2.3 bin/test.py -v
Running CMF Unit Tests
cd $INSTANCE_HOME python2.3 $ZOPE_HOME/bin/testrunner.py -qid Products
cd $INSTANCE_HOME python2.3 $ZOPE_HOME/bin/test.py -v \ --config-file etc/zope.conf \ --libdir Products \ \!test_all
Running Plone Unit Tests
cd $INSTANCE_HOME python2.3 $ZOPE_HOME/bin/testrunner.py -qid Products/CMFPlone/tests
cd $INSTANCE_HOME python2.3 $ZOPE_HOME/bin/test.py -v \ --config-file etc/zope.conf \ --libdir Products/CMFPlone |
[1] If the -f
flag is given, test.py searches for packages named ftests
.
[2] test.py adds the directory specified by the --libdir
option to sys.path.