From 9508151e6c79e5e0deb15083e4dfa1bf689288cb Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Sat, 17 Jan 2015 17:47:49 +0200 Subject: [PATCH] Enable usage of oslo_debug_helper from tox The script oslo_debug_helper enables the usage of Python's pdb without having to do the tedious listing of test cases from testr and then running it. Only thing that needs to be done now is the adding of "import pdb; pdb.set_trace()" as usual and then one can just call: $ tox -e debug And we will end up in the debugger when that test is hit. Note that you can also give a test_regex such as: $ tox -e debug -- some_test_regex To run only tests that match that regex. Change-Id: I63386e68ac3ef5c05bc8290d889efa7f71b33cf1 --- test-requirements.txt | 1 + tox.ini | 3 +++ 2 files changed, 4 insertions(+) diff --git a/test-requirements.txt b/test-requirements.txt index 59579434..2731a978 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,6 +8,7 @@ httpretty>=0.8.0,!=0.8.1,!=0.8.2,!=0.8.3 mock>=1.0 testrepository>=0.0.18 testtools>=0.9.36,!=1.2.0 +oslotest>=1.2.0 # Documentation build requirements sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 diff --git a/tox.ini b/tox.ini index f507c8d4..14cdd1d3 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,9 @@ commands = coverage combine coverage report -m +[testenv:debug] +commands = oslo_debug_helper -t barbicanclient {posargs} + [testenv:pep8] commands = {toxinidir}/tools/hacking.sh {posargs}