Merge "Add support to use pdb with tox"

This commit is contained in:
Jenkins 2016-09-20 15:38:15 +00:00 committed by Gerrit Code Review
commit 45cb85e847
3 changed files with 23 additions and 1 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