[Zope-Coders] reporting failures loading tests from test.py
Jeremy Hylton
jeremy at zope.com
Mon Mar 15 12:33:47 EST 2004
Tres has been rightly complaining that errors that prevent a test suite
from even loading, e.g. a top-level import error in a test module, do
not result in a test failure. test.py prints an error message at the
start, but it can still finish with a report that says all tests passed.
I've checked in a change in Packages/Zope2+3/test.py that reports a
single test error for each failure to load a test module. I'd like to
check it in on the Zope 2 and Zope 3 heads, but it will cause some a
test failure.
On Zope3, we've got at least the following failure:
Traceback (most recent call last):
File "test.py", line 528, in get_suite
mod = package_import(modname)
File "test.py", line 520, in package_import
mod = __import__(modname)
File
"/tmp/autotestYwoOE1/Zope3/src/zope/publisher/tests/test_browserrequest.py", line 33, in ?
from zope.publisher.tests.test_http import HTTPTests
File
"/tmp/autotestYwoOE1/Zope3/src/zope/publisher/tests/test_http.py", line
21, in ?
from zope.app.services.tests.placefulsetup import PlacefulSetup
ImportError: No module named services.tests.placefulsetup
This is a heads up, so that whoever is responsible can fix the test
today. I'll check in the changes later this afternoon. It will
generate output like this:
> ======================================================================
> ERROR: Invalid Test (zope.publisher.tests.test_browserrequest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test.py", line 552, in get_suite
> mod = package_import(modname)
> File "test.py", line 526, in package_import
> mod = __import__(modname)
> File "/home/jeremy/src/Packages/Zope2+3/src/zope/publisher/tests/test_browserrequest.py", line 33, in ?
> File "/home/jeremy/src/Zope2+3/src/zope/publisher/tests/test_http.py", line 21, in ?
> from zope.app.services.tests.placefulsetup import PlacefulSetup
> ImportError: No module named services.tests.placefulsetup
>
> ======================================================================
> ERROR: Invalid Test (zope.publisher.tests.test_http)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test.py", line 557, in get_suite
> suite_func = mod.test_suite
> AttributeError: 'module' object has no attribute 'test_suite'
>
> ----------------------------------------------------------------------
> Ran 59 tests in 9.447s
>
> FAILED (errors=2)
Jeremy
More information about the Zope-Coders
mailing list