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] 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: