Typically I run my python unit test with:
python -m unittest test.<module-name>
I would like to debug my tests using ipdb
but I cannot figure out how to invoke theunittest
module in manner similar to the command above.
The directory structure is:
base/src
for the source codebase/test
for the test code
Tests run from the base
directory.
The preference is to 'run' & 'debug' test cases in the same manner, specifically the preference is to debug with ipdb
in a similar manner to the python command above.
FYI
Interpreter is python2
I don't know how to do this with the unittest module from the standardlib, but the testrunner pytest has at least pdb (not ipdb) support. Just invoke it with
and it drops into pdb with the first failure.