Add the debug flag to tox.ini

Allows us to set a breakpoint in code, using pdb.set_trace().
Documentation on how to debug has also been added.
Change-Id: I34bde581ce331b2eb63e4dab08e9f9c597598bf1
This commit is contained in:
“Fernando 2015-10-15 22:10:54 -05:00
parent 730ee9ce8e
commit 2f47c5f39b
2 changed files with 18 additions and 0 deletions

View File

@ -83,6 +83,21 @@ the functional tests through tox.
By default, the functional tox job will use ``testr`` to execute the
functional tests.
Debugging
---------
In order to be able to debug code in Castellan, you must use the Python
Debugger. This can be done by adding ``import pdb; pdb.set_trace()``
to set the breakpoint. Then run the following command to hit the breakpoint:
.. code-block:: bash
# hit the pdb breakpoint
tox -e debug
Once in the Python Debugger, you can use the commands as stated in the
`Debugger Commands` section here: https://docs.python.org/2/library/pdb.html
Pep8 Check
----------

View File

@ -19,6 +19,9 @@ commands = flake8
[testenv:venv]
commands = {posargs}
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'