[Zope-dev] Re: [Checkins] SVN: Zope/trunk/ Fixed collector 2057: Testing.makequest broke getPhysicalPath()

Florent Guillaume fg at nuxeo.com
Fri Apr 7 08:35:57 EDT 2006


Paul Winkler wrote:
> Using an Item or Folder as your root object for tests works fine except for
> this one issue, so why not allow that?
> My feeling is that setting up an app is unnecessary work when you
> don't need one; for one thing, your test module needs to call
> Zope2.startup() first; for another, afaict creating a Zope2.app is 
> a couple orders of magnitude slower than creating a SimpleItem.
> 
> So maybe more people *should* use makerequest(NotAnApp) ;-)

FWIW usually in my tests I rarely use makerequest.

On the other hand, when testing things that use traversal, it's very common 
that I have to define a fake root object whose getPhysicalPath returns 
('',). It's only a few line, and makes my tests self-contained and much 
easier to understand than relying on the magic of a testing framework 
library (which I tend to hate).

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope-Dev mailing list