Derive outcomes.exit.Exception from SystemExit instead of KeyboardInterrupt

This is required for properly getting out of pdb, where
KeyboardInterrupt is caught in py36 at least.

Ref: https://github.com/pytest-dev/pytest/issues/1865#issuecomment-242599949
This commit is contained in:
Daniel Hahler
2018-11-02 19:50:29 +01:00
parent 038f1f94c2
commit fc4aa27cae
5 changed files with 11 additions and 8 deletions

View File

@@ -553,7 +553,7 @@ def test_outcomeexception_passes_except_Exception():
def test_pytest_exit():
with pytest.raises(pytest.exit.Exception) as excinfo:
pytest.exit("hello")
assert excinfo.errisinstance(KeyboardInterrupt)
assert excinfo.errisinstance(pytest.exit.Exception)
def test_pytest_fail():