setting breakpoints with nosetests --pdb option

前端 未结 4 627
攒了一身酷
攒了一身酷 2021-01-29 20:51

nosetests --pdb let\'s me halt upon error or failure, but this is too late for my needs. Stepping through code during execution helps me debug where the problem is.

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-29 21:15

    You can add

    import pdb; pdb.set_trace() 
    

    anywhere in your source that you want to stop in the debugger.

    Make sure you pass -s to nose so that it does not capture stdout.

提交回复
热议问题