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

@@ -205,7 +205,7 @@ def wrap_session(config, doit):
raise
except Failed:
session.exitstatus = EXIT_TESTSFAILED
except KeyboardInterrupt:
except (KeyboardInterrupt, exit.Exception):
excinfo = _pytest._code.ExceptionInfo.from_current()
exitstatus = EXIT_INTERRUPTED
if initstate <= 2 and isinstance(excinfo.value, exit.Exception):