Python Unit Testing: Automatically Running the Debugger when a test fails November 14, 2023 by Tarik I think what you are looking for is nose. It works like a test runner for unittest. You can drop into the debugger on errors, with the following command: nosetests --pdb