I'm debugging a unit test failure whereby an exception is raised from the guts of some libraries; many exceptions. I'm using ipdb
from the commandline to debug it.
when running ./manage.py test path.to.test
and the exception happens, the test runner catches the exception, prints a stack trace and marks the test failed or whatever. I get why this is useful, rather than letting the exception rise.
In my case, I want it to rise so ipdb
catches it and lands me in a nice position to move up/down frames and debug the issues. I don't want to keep wrapping tests in try
or putting ipdb.set_trace()
calls where the exceptions are thrown. It is a pain and it is slowing down debugging. Ordinarily this isn't an issue, but today it is.
Q: Can I stop the test runner catching the exception so ipdb
catches it instead without code modifications?
I feel like there should be a way to do this, as it would be very helpful when debugging, but I have missed it somewhere along the line.
(Ps, Python 2.7, Django 1.6 sadface)