Is there any convenient way to get an ipdb debugger on an exception, when running tests with python's unittest module?
It's convenient to debug python code using ipython --pdb my_script.py
.
However, when I use the unittest module, with
class MyTestCase(unittest.TestCase):
def runTest(self):
x = 0
y = 3/x
unittest catches the exception and exits.
nosetests --pdb <test file>
is the closest I am aware of but does not use ipdb. I addimport ipdb; ipdb.set_trace()
to force tests to drop into ipdb personally, though I'd love a cmd line way to do it also. – Selfoperating