We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3d8aaa commit d950ddeCopy full SHA for d950dde
testing/test_pdb.py
@@ -2,6 +2,7 @@
2
import sys
3
import platform
4
import os
5
+import signal
6
7
import _pytest._code
8
from _pytest.debugging import SUPPORTS_BREAKPOINT_BUILTIN
@@ -122,6 +123,18 @@ def test_func():
122
123
assert rep.failed
124
assert len(pdblist) == 1
125
126
+ def test_KeyboardInterrupt_exits_pdb(self, testdir, pdblist):
127
+ p1 = testdir.makepyfile("""
128
+ def test_func():
129
+ raise KeyboardInterrupt
130
+ """)
131
+ child = testdir.spawn_pytest("--pdb %s" % p1)
132
+ child.expect("(Pdb)")
133
+ child.kill(signal.SIGINT)
134
+ child.expect("KeyboardInterrupt")
135
+ child.expect("====== 1 failed")
136
+ self.flush(child)
137
+
138
def test_pdb_interaction(self, testdir):
139
p1 = testdir.makepyfile("""
140
def test_1():
0 commit comments