I'm using unittest
.
In case on of my tests in the testcase fails, I like to do something (e.g., save the erroneous output to a temporary folder for later review, etc.).
Where does this code belong?
At first, I thought I could check if self.assertEqual(...)
, but it turns out this function doesn't return any value. It makes sense now, since it is intended to kick the execution out of the test function once failure is detected.
tearDown
is called regardless of the test success, so it doesn't seem to help either.