Yelp/Testify — pull request #80 by andyisimprovised (2012-05-25 09:56:26+00:00)
Title: Added new option to testify to go into post mortem debugging mode when exception is raised.

Hey Testitfiers,

If an exception is raised during any user defined function, testify can throw the tester into a ipdb post_mortem debugging shell to inspect the environment in which the exception was raised. I thought this feature would be super nifty for avoiding the lengthier process of going to the line number in the code, writing a set trace by hand, and then re-running the test suite. It was pretty easy to add. Hard to test automatically unfortunately because the external programmable behavior of testify is identical to it without the feature. I can throw a file which demos it on the repo if requested, but the file won't assert the feature's correctness. Any ideas for an automatic test?

Decided not to go the plugin route because it would require preparing each test_case object by wrapping all the user defined functions in the class. This is non-trivial because of test case inheritance, dynamically defined method names, etc... Way more complex code => more bugs.

I tried making it flexible in usage of pdb if ipdb didn't exist, but I kept running into some very strange behavior where code was disappearing during post mortem debugging. I'm not sure what that's all about, so I didn't implement this. Nevertheless, a strict dependency on ipdb is okay, temporarily.