setting breakpoints with nosetests --pdb option

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? В настоящее время я использую:

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

Это решение не подходит. Нозетесты мешают выводу pdb, и мои элементы управления с клавиатуры (например, клавиши со стрелками) не работают.

Использование import pdb; pdb.set_trace () может показаться хорошей идеей, однако ностесты блокируют мой доступ к консоли pdb.

82
задан gerrit 20 February 2019 в 09:47
поделиться