[Zope-CMF] Re: CachingPolicyManager improvements checked in to svn

Geoff Davis geoff at phds.org
Thu Sep 8 13:57:01 EDT 2005

On Thu, 08 Sep 2005 19:24:51 +0200, yuppie wrote:

> Knock! Knock! Anybody there?
> I told you twice that I'm concerned about using PortalTestCase:
> http://mail.zope.org/pipermail/zope-cmf/2005-September/022891.html
> Would be nice to get some feedback. Obviously you don't share those 
> concerns. What do you propose to do if changes in CMF make a new version 
> of PortalTestCase necessary?
> Florent also raised (different) concerns about using PortalTestCase:
> http://mail.zope.org/pipermail/zope-cmf/2005-September/022917.html

Perhaps I wasn't clear earlier when I said that I thought we should ship
our own CMFDefaultTestCase with the CMF?  If I am understanding you
correctly, shipping a CMF-specific CMFDefaultTestCase should address your
dependency concerns.  RE Florian's comment, CMFDefaultTestCase would be
for use in situations that require that a full portal be instantiated; for
other use cases, use something else.  I personally don't think speed is
all that important in unit tests.

> That's obviously not true in your setup. Looking again at these tests it 
> would be more robust to include the interface imports in the try/except 
> ImportError statement.

So I would imagine that the same arguments about tests behaving without
additional products being installed would apply to Five as well as to
ZopeTestCase ;)

>> One other frustration: I was able to run my new tests in isolation, but
>> when I ran the whole test suite, they failed.  The problem appears to be
>> that somehow some things that happen in test_ActionProviderBase.py are not
>> being cleaned up before test_Template304Handling.py.  Some items placed in
>> the CMFSetup profile registry in test_ActionProviderBase.py are still
>> present when test_Template304Handling.py runs.  I added a workaround that
>> clears out profile_registry, but that shouldn't be necessary.  I don't
>> know if the problem is with the test runner or with
>> test_ActionProviderBase.py, but it's definitely bad that state from one
>> test is affecting another.  This problem appeared in both Zope 2.7.7 and
>> Zope 2.8.1.
> I guess ZopeTestCase installs again products that are already installed. 
> The registry raises errors if the same product is registered twice.
> Not sure how to resolve this.

I believe that ZopeTestCase has some way of avoiding double imports since
we have big test suites in Plone that all do their own imports.  I don't
know the details, but perhaps Stefan Holek would?  I am not so sure it is
a ZopeTestCase specific problem -- perhaps things have been running fine
to date only because test_ActionProviderBase.py is the only test that does
these kinds of imports.


More information about the Zope-CMF mailing list