[TIP] always call teardownX even if setupX fails?
robertc at robertcollins.net
Wed Jan 27 13:19:03 PST 2010
On Wed, 2010-01-27 at 18:07 +0100, holger krekel wrote:
> > Any test with moderately complex external fixtures would benefit
> > this behavior. We use a subclass of unittest.TestCase that always
> > tearDown() for all of our tests at Racemi.
> thanks for your feedback. py.test will do that as well with 1.2.1 -
> the addition that triggering "Skipped" exceptions in a setup function
> not call teardown.
self.foo = get_foo()
if not isinstance(self.foo, TestableThing):
Why should this /not/ call tearDown ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: This is a digitally signed message part
More information about the testing-in-python