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

Function pytest_runtest_makereport

src/_pytest/unittest.py:509–524  ·  view source on GitHub ↗
(item: Item, call: CallInfo[None])

Source from the content-addressed store, hash-verified

507
508@hookimpl(tryfirst=True)
509def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> None:
510 if isinstance(item, TestCaseFunction):
511 if item._excinfo:
512 call.excinfo = item._excinfo.pop(0)
513 try:
514 del call.result
515 except AttributeError:
516 pass
517
518 # Convert unittest.SkipTest to pytest.skip.
519 # This covers explicit `raise unittest.SkipTest`.
520 unittest = sys.modules.get("unittest")
521 if unittest and call.excinfo and isinstance(call.excinfo.value, unittest.SkipTest):
522 excinfo = call.excinfo
523 call2 = CallInfo[None].from_call(lambda: skip(str(excinfo.value)), call.when)
524 call.excinfo = call2.excinfo
525
526
527def _is_skipped(obj) -> bool:

Callers

nothing calls this directly

Calls 3

popMethod · 0.80
from_callMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected