This question pertains to PyUnit, esp. unittest.TestCase subclasses.

Does anyone know of a way from within the TestCase tearDown() method
to determine whether the current test succeeded or not?

What I'm after is a specialized clean-up approach for error/failure
cases.

This is somewhat related to some earlier threads in this group about
using fixtures across test invocations.  I'm functionally testing a
system that uses a database.  Successful tests are guaranteed to
restore the system's data fixtures to initial state, but when tests
fail or error-out we want to do a brute-force re-initialization of the
server so downstream tests can continue.  This re-initialization takes
time so we don't want to do it in every tearDown(), just on error/
failure tearDown()'s.

TIA,
Chris

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to