use oslotest to break into the debugger when running test cases

Once we add debug testenv, we can use "tox -e debug" to debug test cases
when tox is running. Then tox will use oslotest which really debug our
test cases.

Only we should do is insert pdb into code.It's easy to use.

The same in trove:
https://review.openstack.org/#/c/265524/

usage link:
http://docs.openstack.org/developer/oslotest/features.html

Change-Id: I93709451af9a14fc9c71e1c3306a1a025aee8b44
This commit is contained in:
ting.wang
2016-01-12 11:27:57 +08:00
committed by ting wang
parent 261c088eac
commit e9e4c142b4
2 changed files with 12 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ hacking<0.11,>=0.10.0
coverage>=3.6
discover
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
requests-mock>=0.7.0 # Apache-2.0
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
testrepository>=0.0.18

11
tox.ini
View File

@@ -20,6 +20,17 @@ commands = find . -type f -name "*.pyc" -delete
python setup.py testr --testr-args='{posargs}'
whitelist_externals = find
[testenv:debug]
commands = oslo_debug_helper -t troveclient/tests {posargs}
[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper -t troveclient/tests {posargs}
[testenv:debug-py34]
basepython = python3.4
commands = oslo_debug_helper -t troveclient/tests {posargs}
[testenv:pep8]
commands = flake8