On Thursday 11 January 2007 16:03, Dieter Maurer wrote: > Stephan Richter wrote at 2007-1-11 03:12 -0500: > > ... > >If you are populating the CA before ZCML is fully parsed, then: > > > >DO NOT POPULATE THE CA WHILE IMPORTING!!! > > > >This is so bad on so many levels. Dieter, your problem is just one > > example. Another is that unit tests have no chance to work reliably > > either. > > How do you solve the unit test issues when the CA is initialized > and populated by ZCML only? Do you fully parse the ZCML configuration > file before any unit test?
For unit tests we do not use ZCML, we use the zope.component API. In those cases, however, we still do not have side-effects from importing. The unit test case is much easier, since you only test a unit and within this units conflicts of declarations are highly unlikely. > In my specific case, tests would make no problems (as we have > only a single thread) -- but of course, you had the general > case in view. Yes, I tried to make a general statement to the generall developer. My intent was not going to make a detailed discussions of all the pros and cons. After all, this was the zope@zope.org mailing list and not zope3-users or zope3-dev. ;-) Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )