Last active
August 29, 2015 14:06
-
-
Save weissjeffm/96622ca0c21ad095cb28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In [2]: | |
| def mytest(): | |
| try: | |
| print "running test" | |
| raise Exception("oh noes") | |
| finally: | |
| print "cleaning up test" | |
| def pytest_exception_interact(): | |
| print "handling error" | |
| def pytest_test_runner(test): | |
| try: | |
| print "starting test" | |
| test() | |
| except: | |
| print "test failed" | |
| pytest_exception_interact() | |
| finally: | |
| print "pytest cleaning up" | |
| pytest_test_runner(mytest) | |
| starting test | |
| running test | |
| cleaning up test | |
| test failed | |
| handling error | |
| pytest cleaning up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment