MCPcopy Create free account
hub / github.com/pytest-dev/pytest / pytest_runtestloop

Function pytest_runtestloop

src/_pytest/hookspec.py:407–424  ·  view source on GitHub ↗

Perform the main runtest loop (after collection finished). The default hook implementation performs the runtest protocol for all items collected in the session (``session.items``), unless the collection failed or the ``collectonly`` pytest option is set. If at any point :py:func:`p

(session: "Session")

Source from the content-addressed store, hash-verified

405
406@hookspec(firstresult=True)
407def pytest_runtestloop(session: "Session") -> Optional[object]:
408 """Perform the main runtest loop (after collection finished).
409
410 The default hook implementation performs the runtest protocol for all items
411 collected in the session (``session.items``), unless the collection failed
412 or the ``collectonly`` pytest option is set.
413
414 If at any point :py:func:`pytest.exit` is called, the loop is
415 terminated immediately.
416
417 If at any point ``session.shouldfail`` or ``session.shouldstop`` are set, the
418 loop is terminated after the runtest protocol for the current item is finished.
419
420 :param pytest.Session session: The pytest session object.
421
422 Stops at first non-None result, see :ref:`firstresult`.
423 The return value is not used, but only stops further processing.
424 """
425
426
427@hookspec(firstresult=True)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected