Skip to content

Commit 02053bf

Browse files
committed
debugging: rename internal wrapper for pdb.Pdb
This is useful/clearer in case of errors / tracebacks - i.e. you see clearly that it is coming from pytest.
1 parent ac7ee40 commit 02053bf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/_pytest/debugging.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,18 @@ def _init_pdb(cls, *args, **kwargs):
143143
else:
144144
tw.sep(">", "PDB set_trace")
145145

146-
class _PdbWrapper(cls._pdb_cls, object):
146+
class PytestPdbWrapper(cls._pdb_cls, object):
147147
_pytest_capman = capman
148148
_continued = False
149149

150150
def do_debug(self, arg):
151151
cls._recursive_debug += 1
152-
ret = super(_PdbWrapper, self).do_debug(arg)
152+
ret = super(PytestPdbWrapper, self).do_debug(arg)
153153
cls._recursive_debug -= 1
154154
return ret
155155

156156
def do_continue(self, arg):
157-
ret = super(_PdbWrapper, self).do_continue(arg)
157+
ret = super(PytestPdbWrapper, self).do_continue(arg)
158158
if cls._recursive_debug == 0:
159159
tw = _pytest.config.create_terminal_writer(cls._config)
160160
tw.line()
@@ -188,7 +188,7 @@ def set_quit(self):
188188
could be handled, but this would require to wrap the
189189
whole pytest run, and adjust the report etc.
190190
"""
191-
super(_PdbWrapper, self).set_quit()
191+
super(PytestPdbWrapper, self).set_quit()
192192
if cls._recursive_debug == 0:
193193
outcomes.exit("Quitting debugger")
194194

@@ -198,15 +198,15 @@ def setup(self, f, tb):
198198
Needed after do_continue resumed, and entering another
199199
breakpoint again.
200200
"""
201-
ret = super(_PdbWrapper, self).setup(f, tb)
201+
ret = super(PytestPdbWrapper, self).setup(f, tb)
202202
if not ret and self._continued:
203203
# pdb.setup() returns True if the command wants to exit
204204
# from the interaction: do not suspend capturing then.
205205
if self._pytest_capman:
206206
self._pytest_capman.suspend_global_capture(in_=True)
207207
return ret
208208

209-
_pdb = _PdbWrapper(**kwargs)
209+
_pdb = PytestPdbWrapper(**kwargs)
210210
cls._pluginmanager.hook.pytest_enter_pdb(config=cls._config, pdb=_pdb)
211211
else:
212212
_pdb = cls._pdb_cls(**kwargs)

0 commit comments

Comments
 (0)