Say I have this function:
def tearDown(self):
""" clean up by closing the browser window """
self.driver.quit()
I want to skip closing the browser if the test failed or errored out (so I can examine what was on the screen when the test last left off). Is this possible?
Let's say I don't even care if the browser closes, because I can do
self.driver.save_screenshot('path')
I still need the "if test failed" logic to make that happen, so I won't have to dig through hundreds of screenshots to find the failed test.
I'm using nose as my test runner (http://nose.readthedocs.org/en/latest/).