[py-dev] py.test and asserts in method_teardown
fijal at genesilico.pl
Wed Aug 8 10:44:36 CEST 2007
Johan Björk wrote:
> First post on the list, please excuse me if I don't follow normal
> guidelines for posting here...
> I'm having an assert in my method_teardown, which gives rather
> confusing results.
> See attached short example (ugly)
> Running py.test on this testclass, you will get an output similar to:
> entrypoint: TestMyClass().testApa3 _________________________________________
> def teardown_method(self,method):
> E assert 0
>> assert 0
> I would have expected to get "testApa2" as the entrypoint.
Yes, this is known issue, although thanks for spotting.
The reason is that teardown_method is called only when trying to access
next test. I hope to have it fixed this week. (I can explain in more
detail if you're interested)
PS Posting this way is perfectly fine.
More information about the Pytest-dev