def tearDown(self):
    if sys.exc_info()[0]:
        path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
            '../failures', self.driver.browser)
How to execute code only on test failures with python unittest2?