Skip to content

Commit

Permalink
fixup! fixup! pdb: resume capturing after continue
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Mar 26, 2018
1 parent 6e61615 commit 6e97cf6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions _pytest/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,22 @@ def do_continue(self, arg):
tw = _pytest.config.create_terminal_writer(cls._config)
tw.line()
tw.sep(">", "PDB continue (IO-capturing resumed)")
self._pytest_capman.resumecapture()
self._pytest_capman.resume_global_capture()
return ret
do_c = do_cont = do_continue

def setup(self, f, tb):
"""Suspend on setup().
Needed after continue resumed, and entering a breakpoint.
Needed after do_continue resumed, and entering another
breakpoint again.
Should get skipped on the first call probably."""
ret = super(PytestPdb, self).setup(f, tb)
if not ret:
# pdb.setup() returns True if the command wants to exit
# from the interaction: do not suspend capturing then.
if self._pytest_capman:
self._pytest_capman.suspendcapture(in_=True)
self._pytest_capman.suspend_global_capture(in_=True)
return ret

_pdb = PytestPdb()
Expand Down

0 comments on commit 6e97cf6

Please sign in to comment.