Skip to content

Commit aeb6ff5

Browse files
committed
Add pytest_leave_pdb hook
1 parent 2cc36ad commit aeb6ff5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/_pytest/debugging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def do_continue(self, arg):
103103
tw.line()
104104
tw.sep(">", "PDB continue (IO-capturing resumed)")
105105
self._pytest_capman.resume_global_capture()
106+
cls._pluginmanager.hook.pytest_leave_pdb(config=cls._config)
106107
return ret
107108
do_c = do_cont = do_continue
108109

src/_pytest/hookspec.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,3 +575,13 @@ def pytest_enter_pdb(config):
575575
576576
:param _pytest.config.Config config: pytest config object
577577
"""
578+
579+
580+
def pytest_leave_pdb(config):
581+
""" called when leaving pdb (e.g. with continue after pdb.set_trace()).
582+
583+
Can be used by plugins to take special action just after the python
584+
debugger leaves interactive mode.
585+
586+
:param _pytest.config.Config config: pytest config object
587+
"""

0 commit comments

Comments
 (0)