[Zope-dev] unit tests

Miles miles at jamkit.com
Thu Apr 12 07:35:31 EDT 2007


Hi,

I am running a set of unit tests for a custom product nightly via a 
buildbot installation, via bin/zopectl test -s Products.MyProduct in 
zope 2.9.

Sorry in advance that this looks complicated - my query is actually 
pretty straightforward!

Recently, I introduced a bug in the __init__.py of the product, which 
caused the product installation to fail in zope.  The following was 
written to stdout:

2007-04-12 10:05:34 ERROR Zope Couldn't install CMFMyProduct
Traceback (most recent call last):
   File "/usr/local/Zope-2.9.5/lib/python/OFS/Application.py", line 783, 
in install_product
     initmethod(context)
   File 
"/home/buildslave/buildslaves/astrodon/build/Zope-2.9.5/Products/CMFMyProduct/__init__.py", 
line 227, in initialize
     context.registerClass(MyModule.MyClass,
NameError: global name 'MyModule' is not defined

The trivial error was that MyModule was not imported earlier in __init__.py

However, having logged this, the testrunner proceeded to run all my 
tests correctly, and so the buildbot reported a pass.  I expected the 
testrunner to bomb out on encountering this error, but it didn't - 
however if I start zope with zopectl fg, the bug I introduced causes it 
to fail to start.

I'm a bit concerned that there was a false test pass.  Is there a way to 
stop the testrunner in this case, in the same way as running in fg mode?

Thanks,

Miles





More information about the Zope-Dev mailing list