Add support to use pdb with tox

Change-Id: Id1b208843ab038a38f389097baafe985d5ea92e9
This commit is contained in:
Anusha Ramineni 2016-09-20 17:01:48 +05:30
parent 7e2e9f7aa9
commit cf68b457bc
3 changed files with 24 additions and 2 deletions

View File

@ -296,7 +296,25 @@ Read the HTML documentation
Open doc/html/index.html in a browser
4.3 Upgrade
4.3 Debugging unit tests
------------------------
In order to break into the debugger from a unit test we need to insert
a breaking point to the code:
.. code-block:: python
import pdb; pdb.set_trace()
Then run ``tox`` with the debug environment as one of the following::
tox -e debug
tox -e debug test_file_name.TestClass.test_name
For more information see the `oslotest documentation
<http://docs.openstack.org/developer/oslotest/features.html#debugging-with-oslo-debug-helper>`_.
4.4 Upgrade
-----------
Here are the instructions for upgrading to a new release of the

View File

@ -7,6 +7,7 @@ coverage>=3.6 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0 # BSD
mox3>=0.7.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
requests-mock>=1.0 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
testrepository>=0.0.18 # Apache-2.0/BSD

View File

@ -31,6 +31,9 @@ commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:debug]
commands = oslo_debug_helper -t congress/tests {posargs}
[testenv:bench]
setenv =
TEST_BENCHMARK=true
@ -56,4 +59,4 @@ setenv = PYTHONHASHSEED=0
commands = python setup.py build_sphinx
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html