Add support to use pdb with tox
Change-Id: Id1b208843ab038a38f389097baafe985d5ea92e9
This commit is contained in:
parent
7e2e9f7aa9
commit
cf68b457bc
20
README.rst
20
README.rst
|
@ -296,7 +296,25 @@ Read the HTML documentation
|
||||||
|
|
||||||
Open doc/html/index.html in a browser
|
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
|
Here are the instructions for upgrading to a new release of the
|
||||||
|
|
|
@ -7,6 +7,7 @@ coverage>=3.6 # Apache-2.0
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
mock>=2.0 # BSD
|
mock>=2.0 # BSD
|
||||||
mox3>=0.7.0 # Apache-2.0
|
mox3>=0.7.0 # Apache-2.0
|
||||||
|
oslotest>=1.10.0 # Apache-2.0
|
||||||
requests-mock>=1.0 # Apache-2.0
|
requests-mock>=1.0 # Apache-2.0
|
||||||
python-subunit>=0.0.18 # Apache-2.0/BSD
|
python-subunit>=0.0.18 # Apache-2.0/BSD
|
||||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -31,6 +31,9 @@ commands = {posargs}
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
commands = python setup.py testr --coverage --testr-args='{posargs}'
|
commands = python setup.py testr --coverage --testr-args='{posargs}'
|
||||||
|
|
||||||
|
[testenv:debug]
|
||||||
|
commands = oslo_debug_helper -t congress/tests {posargs}
|
||||||
|
|
||||||
[testenv:bench]
|
[testenv:bench]
|
||||||
setenv =
|
setenv =
|
||||||
TEST_BENCHMARK=true
|
TEST_BENCHMARK=true
|
||||||
|
@ -56,4 +59,4 @@ setenv = PYTHONHASHSEED=0
|
||||||
commands = python setup.py build_sphinx
|
commands = python setup.py build_sphinx
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[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
|
||||||
|
|
Loading…
Reference in New Issue