From 671ab5a36cee2e4110ca12826de8d5ab5ca45aa8 Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Tue, 27 Mar 2018 21:02:43 +1100 Subject: [PATCH] update documentation for new feature --- changelog/3180.feature.rst | 13 +------------ doc/en/usage.rst | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/changelog/3180.feature.rst b/changelog/3180.feature.rst index ee696fad2..9ee4a8a01 100644 --- a/changelog/3180.feature.rst +++ b/changelog/3180.feature.rst @@ -1,12 +1 @@ -Support for Python 3.7s builtin breakpoint() method. - -When breakpoint() is called and PYTHONBREAKPOINT is set to the default value, -PyTest will use the Custom PDB trace UI instead of the system default Pdb. - -When tests are complete, the system will default back to the system Pdb trace UI. - -If --pdb is called on execution of Pytest, the custom Pdb interface is used on both -breakpoint() and failed tests/unhandled exceptions. - -If --pdbcls is used, the custom class will be executed when a test fails (as expected within existing behaviour), -but also when breakpoint() is called from within a test, the custom class debugger will be instantiated. +Support for Python 3.7's builtin ``breakpoint()`` method, see :ref:`breakpoint-builtin` for details. \ No newline at end of file diff --git a/doc/en/usage.rst b/doc/en/usage.rst index 7f967aa4f..5d6a788a6 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -189,6 +189,21 @@ in your code and pytest automatically disables its output capture for that test: for test output occurring after you exit the interactive PDB_ tracing session and continue with the regular test run. + +.. _breakpoint-builtin: + +Using the builtin breakpoint function +------------------------------------- + +Python 3.7 introduces a builtin ``breakpoint()`` function. +Pytest supports the use of ``breakpoint()`` with the following behaviours: + + - When breakpoint() is called and PYTHONBREAKPOINT is set to the default value, PyTest will use the Custom PDB trace UI instead of the system default Pdb. + - When tests are complete, the system will default back to the system Pdb trace UI. + - If --pdb is called on execution of Pytest, the custom Pdb interface is used on both +breakpoint() and failed tests/unhandled exceptions. + - If --pdbcls is used, the custom class will be executed when a test fails (as expected within existing behaviour), but also when breakpoint() is called from within a test, the custom class debugger will be instantiated. + .. _durations: Profiling test execution duration