diff options
author | Brian Maissy <brian.maissy@gmail.com> | 2018-05-02 00:58:35 +0300 |
---|---|---|
committer | Brian Maissy <brian.maissy@gmail.com> | 2018-05-02 00:58:35 +0300 |
commit | c258fe1459638437ba4d2ecd77862091369183e6 (patch) | |
tree | c84a297295b2eebdd410e37c47662a19e613e049 /testing | |
parent | 5ba06638272234d99052d7ebee32fd11e8b63a9e (diff) | |
download | pytest-c258fe1459638437ba4d2ecd77862091369183e6.tar.gz |
--pdb treats KeyboardInterrupt as exception
Diffstat (limited to 'testing')
-rw-r--r-- | testing/test_pdb.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/testing/test_pdb.py b/testing/test_pdb.py index 85817f79b..29277caf1 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -2,6 +2,7 @@ from __future__ import absolute_import, division, print_function import sys import platform import os +import signal import _pytest._code from _pytest.debugging import SUPPORTS_BREAKPOINT_BUILTIN @@ -114,6 +115,14 @@ class TestPDB(object): assert rep.failed assert len(pdblist) == 0 + def test_pdb_on_KeyboardInterrupt(self, testdir, pdblist): + rep = runpdb_and_get_report(testdir, """ + def test_func(): + raise KeyboardInterrupt + """) + assert rep.failed + assert len(pdblist) == 1 + def test_pdb_interaction(self, testdir): p1 = testdir.makepyfile(""" def test_1(): |