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 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 Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   [EMAIL PROTECTED]
Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to