minor: check_interactive_exception: use Skipped

This commit is contained in:
Daniel Hahler 2019-04-03 00:23:10 +02:00
parent db34bf01b6
commit 7538aa7bb9
2 changed files with 3 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import sys
import six
import pytest
from _pytest import python
from _pytest import runner
from _pytest import unittest
@ -26,7 +27,7 @@ def pytest_runtest_makereport(item, call):
if call.excinfo and call.excinfo.errisinstance(get_skip_exceptions()):
# let's substitute the excinfo with a pytest.skip one
call2 = runner.CallInfo.from_call(
lambda: runner.skip(six.text_type(call.excinfo.value)), call.when
lambda: pytest.skip(six.text_type(call.excinfo.value)), call.when
)
call.excinfo = call2.excinfo

View File

@ -16,7 +16,6 @@ from .reports import CollectReport
from .reports import TestReport
from _pytest._code.code import ExceptionInfo
from _pytest.outcomes import Exit
from _pytest.outcomes import skip
from _pytest.outcomes import Skipped
from _pytest.outcomes import TEST_OUTCOME
@ -183,7 +182,7 @@ def call_and_report(item, when, log=True, **kwds):
def check_interactive_exception(call, report):
return call.excinfo and not (
hasattr(report, "wasxfail")
or call.excinfo.errisinstance(skip.Exception)
or call.excinfo.errisinstance(Skipped)
or call.excinfo.errisinstance(bdb.BdbQuit)
)