From a9687a82fc14e3e9f6ce9925d27bf5699308914d Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Mon, 10 Jul 2017 14:41:49 +0100 Subject: [PATCH] Add debug to tox environment The oslotest package distributes a shell file that may be used to assist in debugging python code. The shell file uses testtools, and supports debugging with pdb. To enable debugging, run tox with the debug environment. Below are the following ways to run it. * tox -e debug module * tox -e debug module.test_class * tox -e debug module.test_class.test_method Change-Id: If0b06dcf094682401c4b09dd72493c678ea2a6b0 --- test-requirements.txt | 1 + tox.ini | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/test-requirements.txt b/test-requirements.txt index c69d2a2f5..16c7d8ccf 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,6 +8,7 @@ fixtures>=3.0.0 # Apache-2.0/BSD mock>=2.0 # BSD python-subunit>=0.0.18 # Apache-2.0/BSD openstackdocstheme>=1.11.0 # Apache-2.0 +oslotest>=1.10.0 # Apache-2.0 requests-mock>=1.1 # Apache-2.0 sphinx>=1.6.2 # BSD testrepository>=0.0.18 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index e4aa17752..7ae628f90 100644 --- a/tox.ini +++ b/tox.ini @@ -36,6 +36,12 @@ commands = flake8 shade [testenv:venv] commands = {posargs} +[testenv:debug] +whitelist_externals = find +commands = + find . -type f -name "*.pyc" -delete + oslo_debug_helper {posargs} + [testenv:cover] commands = python setup.py testr --coverage --testr-args='{posargs}'