[z3-five] Re: ~ Zope testing frameworks

Stefan H. Holek stefan at epy.co.at
Sun Sep 12 17:28:51 MEST 2004


On Sep 10, 2004, at 19:24, Tres Seaver wrote:

>
> I am hopeful of extending zopectl to add syntax to do the following:
>
>   $ bin/zopectl test Products.Five # other test.py args, too
>
> which would use the 'test.py' framework, but in the context of the 
> configuration and products of the instance.

Hm, this would need to differ significantly from what zopectl run does 
though. In particular, zopectl test *must not* call Zope.startup() or 
Zope.app() before invoking test.py.

>
> I never set up an application server instance without ZEO, even in a 
> sandbox.  I think ZTC is doing something clever about the database 
> (setting up a new DemoStorage over the "real" storage?) which wasn't 
> compatible with ZEO.
>

This is due to the way you run the tests, most likely.

./bin/zopectl run /Zope/bin/test.py -v --libdir Products/Foo

will always run off the database configured in zope.conf, and not the 
DemoStorage. This is a bad thing in my book (but I am open to 
discussion on this one). The way I see it, a test runner must have 
complete control over the startup process. I have implemented a 
--config-file option for test.py (on 2_7-branch and trunk) that allows 
to run tests like so:

/Zope/bin/test.py -v --config-file etc/zope.conf --libdir Products/Foo

Note also that the test DemoStorage is not set up by ZopeTestCase, but 
by Zope's own Testing package.

>> You guys will both be at the Plone conference (me too). It might be a 
>> good idea for you two to have a chat about test frameworks in Zope, 
>> and what can be done to get Tres less confused about writing Five 
>> tests, and me less confused about what Tres is doing. I just want 
>> everybody to be able to happily contribute code (and thus tests) to 
>> Five.
>
> +1 for that.  I would enjoy chatting about how to get the benefits of 
> both ZTC and the 'test.py' framework.

ZTC tests run just fine with test.py (or testrunner.py, or whatnot). As 
a matter of fact, runalltests.py is nothing but a tiny, featureless 
test runner. It's by no means required.

Looking forward to meeting you all at the conference,

Stefan


--
The time has come to start talking about whether the emperor is as well
dressed as we are supposed to think he is.               /Pete McBreen/



More information about the z3-five mailing list