Python Unit Testing: Automatically Running the Debugger when a test fails

前端 未结 6 1763
日久生厌
日久生厌 2020-12-02 08:24

Is there a way to automatically start the debugger at the point at which a unittest fails?

Right now I am just using pdb.set_trace() manually, but this is very tedio

6条回答
  •  一整个雨季
    2020-12-02 09:11

    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
    

提交回复
热议问题