Question

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.

However, nosetests are helpful as they allow tests that rely on relative imports (i.e. tests in a package).

How can I set breakpoints before the tests are executed? Currently I'm using:

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

This solution isn't adequate. Nosetests interfere with pdb output, and my keyboard controls (e.g. arrow keys) are broken.

Using import pdb; pdb.set_trace() would seem like a good idea, however nosetests is blocking my access to the pdb console.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top