Skip to content

Commit d3dc755

Browse files
committed
squash! fixup! fixup! pdb: resume capturing after continue
Store _pytest_capman on the class, for pdbpp's do_debug hack to keep it. Without this, `debug …` would fail like this: /usr/lib/python3.6/cmd.py:217: in onecmd return func(arg) .venv/lib/python3.6/site-packages/pdb.py:608: in do_debug return orig_do_debug(self, arg) /usr/lib/python3.6/pdb.py:1099: in do_debug sys.call_tracing(p.run, (arg, globals, locals)) /usr/lib/python3.6/bdb.py:434: in run exec(cmd, globals, locals) /usr/lib/python3.6/bdb.py:51: in trace_dispatch return self.dispatch_line(frame) /usr/lib/python3.6/bdb.py:69: in dispatch_line self.user_line(frame) /usr/lib/python3.6/pdb.py:261: in user_line self.interaction(frame, None) .venv/lib/python3.6/site-packages/pdb.py:203: in interaction self.setup(frame, traceback) E AttributeError: 'PytestPdb' object has no attribute '_pytest_capman'
1 parent aeb6ff5 commit d3dc755

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/_pytest/debugging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ def set_trace(cls, set_break=True):
9696
cls._pluginmanager.hook.pytest_enter_pdb(config=cls._config)
9797

9898
class PytestPdb(cls._pdb_cls):
99+
_pytest_capman = capman
100+
99101
def do_continue(self, arg):
100102
ret = super(PytestPdb, self).do_continue(arg)
101103
if self._pytest_capman:
@@ -122,7 +124,6 @@ def setup(self, f, tb):
122124
return ret
123125

124126
_pdb = PytestPdb()
125-
_pdb._pytest_capman = capman
126127
else:
127128
_pdb = cls._pdb_cls()
128129

0 commit comments

Comments
 (0)