Skip to content

Commit

Permalink
Add pytest_leave_pdb hook
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Oct 23, 2018
1 parent 99c869c commit 346add5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/_pytest/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def do_continue(self, arg):
tw.line()
tw.sep(">", "PDB continue (IO-capturing resumed)")
self._pytest_capman.resume_global_capture()
cls._pluginmanager.hook.pytest_leave_pdb(config=cls._config)
return ret

do_c = do_cont = do_continue
Expand Down
10 changes: 10 additions & 0 deletions src/_pytest/hookspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,3 +609,13 @@ def pytest_enter_pdb(config):
:param _pytest.config.Config config: pytest config object
"""


def pytest_leave_pdb(config):
""" called when leaving pdb (e.g. with continue after pdb.set_trace()).
Can be used by plugins to take special action just after the python
debugger leaves interactive mode.
:param _pytest.config.Config config: pytest config object
"""

0 comments on commit 346add5

Please sign in to comment.