[TIP] getting the result of a test in teardown_method?

Hans Sebastian hnsbstn at gmail.com
Sat May 8 22:52:02 PDT 2010

Hi everyone,

I hope this is where people do Q&A on py.test. Otherwise please direct me to
the right place.

I've been using py.test to write test scripts. The tests I write use the
unittest pattern and failure is detected by raising AssertionError. My
question is how can I get the result of a test immediately in my
teardown_method(self, method) or in the pytest_runtest_teardown(item) hook?
The reason I want to know the result at those points is that I want to have
different teardown logics based on the test result.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100508/4fd3ad76/attachment.htm>

More information about the testing-in-python mailing list