Running a test with pdb was difficult because tox captures output and causes pdb prompt to quit. Tips for how to run with debug are provided here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests This change puts these commands into a debug env in tox.ini so you can do a command like tox -e debug pycadf.tests.test_cadf_spec and when it hits your breakpoint you'll get the debug prompt. Change-Id: I53893d618cd60c0456368088497542db7e4a6eac Co-Authored-By: Brant Knudson <bknudson@us.ibm.com>
1.3 KiB
1.3 KiB
Debugging with PDB
Using PDB breakpoints with tox and testr normally doesn't work since the tests just fail with a BdbQuit exception rather than stopping at the breakpoint.
To run with PDB breakpoints during testing, use the
debug tox environment rather than py27. Here's
an example, passing the name of a test since you'll normally only want
to run the test that hits your breakpoint:
$ tox -e debug pycadf.tests.test_cadf_spec
For reference, the debug tox environment implements the
instructions here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests
The pyCADF library provides a tox environment that enables pdb based
debugging of test cases.