Skip to content
Snippets Groups Projects
Commit 3bf571da authored by MD NADEEM's avatar MD NADEEM Committed by Md Nadeem
Browse files

Add support to use pdb with tox

TrivialFix

Change-Id: I6f32ce7033fe5a8b8f628a8f52dde67b9540083d
parent 00d0e1bc
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,25 @@ the ``kolla/tests/test_kolla_docker.py``` file:
$ tox -e py27 test_kolla_docker.ModuleArgsTest.test_module_args
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>`_.
.. rubric:: Footnotes
.. [#f1] See http://docs.openstack.org/infra/system-config/jenkins.html
.. [#f1] See http://docs.openstack.org/infra/system-config/jenkins.html
\ No newline at end of file
......@@ -17,6 +17,9 @@ commands =
find . -type f -name "*.pyc" -delete
python setup.py test --slowest --testr-args='{posargs}'
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:pep8]
commands =
{toxinidir}/tools/run-bashate.sh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment