From dd8aea24bde1195a1479ad17ab8ac23db41113c9 Mon Sep 17 00:00:00 2001 From: Manjeet Singh Bhatia Date: Sat, 28 Apr 2018 00:05:40 +0000 Subject: [PATCH] Add a debug env for unit tests Debugging unit tests locally with pdb ends in failure with tox. this patch adds debug environment to debug tests with pdb break points by following below steps. 1. set break point in code by adding import pdb;pdb.set_trace 2. run tox -e debug test_regex Change-Id: I088a558a1fb68b3bc2a218ccda0911ed1389f91f --- tox.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tox.ini b/tox.ini index 76982009373..c32e0234640 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,9 @@ commands = # there is also secret magic in ostestr which lets you run in a fail only # mode. To do this define the TRACE_FAILONLY environmental variable. +[testenv:debug] +commands = oslo_debug_helper -t neutron/tests {posargs} + [testenv:common] # Fake job to define environment variables shared between dsvm/non-dsvm jobs setenv = OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:180}