From 7eb765578a70a3374c50afcca6b8fe1cf32ce981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sat, 1 Feb 2014 10:07:54 +0100 Subject: [PATCH 1/3] correct inconsistent comment wording Once the 'the' article was used before 'first' and once it was not, all within the same code example. --HG-- branch : pdb_doc_update --- doc/en/usage.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/usage.txt b/doc/en/usage.txt index 29a226dbc..d82061d6a 100644 --- a/doc/en/usage.txt +++ b/doc/en/usage.txt @@ -82,7 +82,7 @@ only want to do this for the first failing test to understand a certain failure situation:: py.test -x --pdb # drop to PDB on first failure, then end test session - py.test --pdb --maxfail=3 # drop to PDB for the first three failures + py.test --pdb --maxfail=3 # drop to PDB for first three failures Setting a breakpoint / aka ``set_trace()`` From 4b81a0730332e71634326a7499a7f322694b4195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sat, 1 Feb 2014 10:11:42 +0100 Subject: [PATCH 2/3] make all 'PDB' doc references be recognized as links --HG-- branch : pdb_doc_update --- doc/en/usage.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/en/usage.txt b/doc/en/usage.txt index d82061d6a..e43f4ff8c 100644 --- a/doc/en/usage.txt +++ b/doc/en/usage.txt @@ -67,13 +67,13 @@ Examples for modifying traceback printing:: py.test --tb=short # a shorter traceback format py.test --tb=line # only one line per failure -Dropping to PDB (Python Debugger) on failures ----------------------------------------------- +Dropping to PDB_ (Python Debugger) on failures +----------------------------------------------- .. _PDB: http://docs.python.org/library/pdb.html Python comes with a builtin Python debugger called PDB_. ``pytest`` -allows one to drop into the PDB prompt via a command line option:: +allows one to drop into the PDB_ prompt via a command line option:: py.test --pdb @@ -98,7 +98,7 @@ can use a helper:: .. versionadded: 2.0.0 -In previous versions you could only enter PDB tracing if +In previous versions you could only enter PDB_ tracing if you disabled capturing on the command line via ``py.test -s``. .. _durations: From 6910641266120756a9f5bc35f31bd72103dd5d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sat, 1 Feb 2014 10:19:09 +0100 Subject: [PATCH 3/3] reword PDB usage documentation Documented that since pytest 2.4.0 you can use the raw pdb.set_trace() call directly without the pytest.set_trace() wrapper or explicitly disabling pytest's output capture using 'py.test -s'. Clearly stated how pytest (since version 2.0.0.) automatically disables its output capture when entering an interactive PDB debugger. This avoids confusing new users because their tests display different output when running with or without entering an interactive debugger (even if user does nothing in that interactive debugger session other than exit it and continue with the regular test execution). --HG-- branch : pdb_doc_update --- doc/en/usage.txt | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/en/usage.txt b/doc/en/usage.txt index e43f4ff8c..761be48a7 100644 --- a/doc/en/usage.txt +++ b/doc/en/usage.txt @@ -98,8 +98,24 @@ can use a helper:: .. versionadded: 2.0.0 -In previous versions you could only enter PDB_ tracing if -you disabled capturing on the command line via ``py.test -s``. +Prior to pytest version 2.0.0 you could only enter PDB_ tracing if you disabled +capturing on the command line via ``py.test -s``. In later versions, pytest +automatically disables its output capture when you enter PDB_ tracing: + +* Output capture in other tests is not affected. +* Any prior test output that has already been captured and will be processed as + such. +* Any later output produced within the same test will not be captured and will + instead get sent directly to ``sys.stdout``. Note that this holds true even + for test output occuring after you exit the interactive PDB_ tracing session + and continue with the regular test run. + +.. versionadded: 2.4.0 + +Since pytest version 2.4.0 you can also use the native Python +``import pdb;pdb.set_trace()`` call to enter PDB_ tracing without having to use +the ``pytest.set_trace()`` wrapper or explicitly disable pytest's output +capturing via ``py.test -s``. .. _durations: