From 2f47c5f39ba20b67b479f5531ece96c2f855589c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CFernando?= Date: Thu, 15 Oct 2015 22:10:54 -0500 Subject: [PATCH] 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 --- doc/source/testing.rst | 15 +++++++++++++++ tox.ini | 3 +++ 2 files changed, 18 insertions(+) diff --git a/doc/source/testing.rst b/doc/source/testing.rst index 82eca9dd..7ea405a8 100644 --- a/doc/source/testing.rst +++ b/doc/source/testing.rst @@ -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 ---------- diff --git a/tox.ini b/tox.ini index 6315e8c1..1302a234 100644 --- a/tox.ini +++ b/tox.ini @@ -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}'