ZopeTestCase and Zope.Startup() interactions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Stefan Holek and I have discovered some tricky interactions of ZopeTestCase tests and tests using Zope.Startup().
1. If you first run a test that uses Zope.Startup() and later run a test using ZopeTestCases installProduct() the product will get installed twice, first by Zope.Startup() and then by installProduct. This is not only a waste of processing time, it also causes test failures if the product you install uses CMFStetup. This is probably why this bug hasn't appeared before, CMFSetup is pretty new.
A fix for this exists in svn+ssh://<email address hidden>
2. If you first run a test using ZopeTestCase, and then run a test using Zope.Startup() Zope.Startup() will not install any products. I haven't tested this (it's according to Stefan Holek). This will happen for example if you have Archetypes installed and run all tests in Products, with "bin/zopectl test" or similar.
I don't have a solution for this yet.
"Discovered some tricky interactions" is not entirely correct. I knew about this all along ;-)
One of the very reasons of ZTC's existence is that Zope.startup() was perceived to suck for testing. This is why there is a ZopeLite module in the first place. Zope.startup() pulls in *all* products which may be fine for testing the Zope core, but is not desirable when testing add-on products. That's because
a) It is unbearably slow.
b) You never really know what is actually installed.
So, mixing ZTC and non-ZTC tests in a single run was never in the cards, and I don't consider this a "bug" either.
Let's see what we can do once Lennart has landed his branch...