MCPcopy
hub / github.com/pytest-dev/pytest / check_interactive_exception

Function check_interactive_exception

src/_pytest/runner.py:270–285  ·  view source on GitHub ↗

Check whether the call raised an exception that should be reported as interactive.

(call: CallInfo[object], report: BaseReport)

Source from the content-addressed store, hash-verified

268
269
270def check_interactive_exception(call: CallInfo[object], report: BaseReport) -> bool:
271 """Check whether the call raised an exception that should be reported as
272 interactive."""
273 if call.excinfo is None:
274 # Didn't raise.
275 return False
276 if hasattr(report, "wasxfail"):
277 # Exception was expected.
278 return False
279 unittest = sys.modules.get("unittest")
280 if isinstance(call.excinfo.value, Skipped | bdb.BdbQuit) or (
281 unittest is not None and isinstance(call.excinfo.value, unittest.SkipTest)
282 ):
283 # Special control flow exception.
284 return False
285 return True
286
287
288TResult = TypeVar("TResult", covariant=True)

Callers 4

__exit__Method · 0.90
addSubTestMethod · 0.90
call_and_reportFunction · 0.85
collect_one_nodeFunction · 0.85

Calls 1

getMethod · 0.45

Tested by 2

__exit__Method · 0.72
addSubTestMethod · 0.72