Skip to content

Commit 4d2916e

Browse files
committed
Add pytest_leave_pdb hook
1 parent 8247af1 commit 4d2916e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

_pytest/debugging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def do_continue(self, arg):
8484
tw.line()
8585
tw.sep(">", "PDB continue (IO-capturing resumed)")
8686
self._pytest_capman.resume_global_capture()
87+
cls._pluginmanager.hook.pytest_leave_pdb(config=cls._config)
8788
return ret
8889
do_c = do_cont = do_continue
8990

_pytest/hookspec.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,13 @@ def pytest_enter_pdb(config):
550550
551551
:param _pytest.config.Config config: pytest config object
552552
"""
553+
554+
555+
def pytest_leave_pdb(config):
556+
""" called when leaving pdb (e.g. with continue after pdb.set_trace()).
557+
558+
Can be used by plugins to take special action just after the python
559+
debugger leaves interactive mode.
560+
561+
:param _pytest.config.Config config: pytest config object
562+
"""

0 commit comments

Comments
 (0)