[TIP] always call teardownX even if setupX fails?

Robert Collins robertc at robertcollins.net
Thu Jan 28 04:47:01 PST 2010


On Thu, 2010-01-28 at 13:10 +0100, holger krekel wrote:
> 
> 
> not calling teardown seemed slightly easier to implement ... i can
> work
> a bit harder though :) 
> 
> However, I haven't see your example pattern with py.test usages yet.  
> Is this a an example from actual code? 

Broadly yes. Usually seen more like this in fact:

class A
   setUp(): does stuff

class B(A):
   setUp(): check if we should skip

> And if so do you have have and use it in setup_module and setup_class
> - alike 
> methods?

I don't use such methods, so no (see prior conversation about decoupling
resources etc).

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100128/73392791/attachment.pgp>


More information about the testing-in-python mailing list