[TIP] always call teardownX even if setupX fails?
holger at merlinux.eu
Wed Jan 27 09:07:45 PST 2010
Hi Rob, hi Doug,
On Sat, Jan 23, 2010 at 10:47 -0500, Doug Hellmann wrote:
> On Jan 23, 2010, at 5:51 AM, Robert Collins wrote:
>> On Sat, 2010-01-23 at 00:43 +0100, holger krekel wrote:
>>> Doesn't look like a blocker to me at the moment. What do you think?
>>> Any objections or recommendations? Do you regard consistency a
>> Trial and testtools run tearDown unconditionally even though its
>> inconsistent with unittest. I'm a big fan of doing that, and encourage
>> you to do it in py.test.
> Any test with moderately complex external fixtures would benefit from
> this behavior. We use a subclass of unittest.TestCase that always calls
> tearDown() for all of our tests at Racemi.
thanks for your feedback. py.test will do that as well with 1.2.1 - with
the addition that triggering "Skipped" exceptions in a setup function will
not call teardown.
More information about the testing-in-python