summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBrad Topol <btopol@us.ibm.com>2014-07-27 23:23:35 -0500
committerBrad Topol <btopol@us.ibm.com>2014-07-28 13:58:57 -0500
commit02c6e369060da29192768076eb932067b9b5c3ef (patch)
tree420e9d33300ce6f532550f42a2717404198be0f7 /doc
parent39aeafdec66011606a1f9603be1ff390e02bd855 (diff)
downloadpycadf-02c6e369060da29192768076eb932067b9b5c3ef.tar.gz
Debug env for tox
Running a test with pdb was difficult because tox captures output and causes pdb prompt to quit. Tips for how to run with debug are provided here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests This change puts these commands into a debug env in tox.ini so you can do a command like tox -e debug pycadf.tests.test_cadf_spec and when it hits your breakpoint you'll get the debug prompt. Change-Id: I53893d618cd60c0456368088497542db7e4a6eac Co-Authored-By: Brant Knudson <bknudson@us.ibm.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/source/debugging.rst35
-rw-r--r--doc/source/index.rst1
2 files changed, 36 insertions, 0 deletions
diff --git a/doc/source/debugging.rst b/doc/source/debugging.rst
new file mode 100644
index 0000000..3aca00b
--- /dev/null
+++ b/doc/source/debugging.rst
@@ -0,0 +1,35 @@
+..
+ Copyright 2014 IBM Corp.
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and limitations
+ under the License.
+
+.. _debugging:
+
+===================
+ Debugging with PDB
+===================
+
+Using PDB breakpoints with tox and testr normally doesn't work since the tests
+just fail with a BdbQuit exception rather than stopping at the breakpoint.
+
+To run with PDB breakpoints during testing, use the ``debug`` tox environment
+rather than ``py27``. Here's an example, passing the name of a test since
+you'll normally only want to run the test that hits your breakpoint::
+
+ $ tox -e debug pycadf.tests.test_cadf_spec
+
+For reference, the ``debug`` tox environment implements the instructions
+here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests
+The pyCADF library provides a tox environment that enables pdb based
+debugging of test cases.
+
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 37c2d9d..7545376 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -51,6 +51,7 @@ Developer Documentation
:maxdepth: 1
contributing
+ debugging
specification/index
Code Documentation