python - setting breakpoints with nosetests --pdb option -


nosetests --pdb let's me halt upon error or failure, late needs. stepping through code during execution helps me debug problem is.

however, nosetests helpful allow tests rely on relative imports (i.e. tests in package).

how can set breakpoints before tests executed? i'm using:

python -m pdb /path/to/my/nosetests testfile.py 

this solution isn't adequate. nosetests interfere pdb output, , keyboard controls (e.g. arrow keys) broken.

using import pdb; pdb.set_trace() seem idea, nosetests blocking access pdb console.

you can add

import pdb; pdb.set_trace()  

anywhere in source want stop in debugger.

make sure pass -s nose not capture stdout.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -