dimanche 26 juillet 2015

ipdb with python unittest module

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.

Aucun commentaire:

Enregistrer un commentaire