Skip to content

Commit a36ed25

Browse files
committed
pdb: do not raise outcomes.Exit with quit in debug
1 parent 7764312 commit a36ed25

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/_pytest/debugging.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,15 @@ def do_continue(self, arg):
128128
do_c = do_cont = do_continue
129129

130130
def set_quit(self):
131+
"""Raise Exit outcome when quit command is used in pdb.
132+
133+
This is a bit of a hack - it would be better if BdbQuit
134+
could be handled, but this would require to wrap the
135+
whole pytest run, and adjust the report etc.
136+
"""
131137
super(_PdbWrapper, self).set_quit()
132-
outcomes.exit("Quitting debugger")
138+
if cls._recursive_debug == 0:
139+
outcomes.exit("Quitting debugger")
133140

134141
def setup(self, f, tb):
135142
"""Suspend on setup().

0 commit comments

Comments
 (0)