Search the web
Sign In
New User? Sign Up
zope
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
[Zope-dev] test setup layer sorting   Message List  
Reply | Forward Message #184169 of 185485 |
Re: [Zope-dev] test setup layer sorting

On Mon, Jul 13, 2009 at 3:36 PM, Marius Gedminas<marius@...> wrote:
> Fortunately, the NotImplementedError in ZCMLLayer's tearDown is just a
> precaution, 99% of the time it is sufficient to run CleanUp.tearDown
> to get the global state restored to its pristine condition.

Keep in mind that a number of commonly-used ZCML directives stamp
interfaces on classes; these aren't cleaned up with the general
tear-down.

If each layer stamps the same interfaces on the same classes, the only
issue is ensuring that unit tests run first. If, however, you have
different layers that may apply different sets of interfaces to
different classes, you're may be relying on the process boundary as
part of the required isolation.


-Fred

--
Fred L. Drake, Jr. <fdrake at gmail.com>
"Chaos is the score upon which reality is written." --Henry Miller
_______________________________________________
Zope-Dev maillist - Zope-Dev@...
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )



Mon Jul 13, 2009 8:51 pm

fdrake@...
Send Email Send Email

Forward
Message #184169 of 185485 |
Expand Messages Author Sort by Date

zope/testing/testrunner/runner.py's order_by_bases() function orders layers by inheritance, basically. So if you've got a FunctionalTestLayer that inherits...
Reinout van Rees
reinout@...
Send Email
Jul 13, 2009
9:28 am

... Whatever grok does that interferes with coverage should be fixed. ... Personally I would much prefer for the unit test layer to be sorted first. It is...
Marius Gedminas
marius@...
Send Email
Jul 13, 2009
10:00 am

... +1 -- Benji York Senior Software Engineer Zope Corporation _______________________________________________ Zope-Dev maillist - Zope-Dev@... ...
Benji York
benji@...
Send Email
Jul 13, 2009
1:09 pm

... I did some more debugging. In the end it boils down to this: With z3c.testsetup, you can specify a zcml file at the top of your test file. z3c.testsetup...
Reinout van Rees
reinout@...
Send Email
Jul 13, 2009
12:28 pm

... Ah, that one. zope.testing supports test layers that muck up the global state irrepairably (by letting the layer's tearDown method raise ...
Marius Gedminas
marius@...
Send Email
Jul 13, 2009
7:36 pm

... Keep in mind that a number of commonly-used ZCML directives stamp interfaces on classes; these aren't cleaned up with the general tear-down. If each layer...
Fred Drake
fdrake@...
Send Email
Jul 13, 2009
8:52 pm

... Thanks a lot, now I finally understand the cause of the problem I've been seeing. It is OK to figure out *when* something goes wrong, but the *why* is ...
Reinout van Rees
reinout@...
Send Email
Jul 14, 2009
3:51 pm

... z3c.testsetup is great as it cuts down on the amount of repeated test setup code. (iirc stuff like nose and py.test also try this). Uli (=z3c.testsetup...
Reinout van Rees
reinout@...
Send Email
Jul 14, 2009
3:55 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help