Debugging django/unittest?
问题 I'm wondering if anybody has a hint on how to debug a unittest, or any other piece of code in django, for that matter, using a debugger like winpdb? I'm trying to to a winpdb manage.py test photo which runs my unittest for my photo app, but winpdb crashes. Are there alternatives? What is the best way to do this? I'm running linux, ubuntu 10.10. 回答1: You can use pdb to debug your program. import pdb def some_function(): pdb.set_trace() some_other_computation() When the program hits the set