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

Method get_reported_items

testing/test_collection.py:485–493  ·  view source on GitHub ↗

Return pytest.Item instances reported by the pytest_collectreport hook

(self, hookrec: HookRecorder)

Source from the content-addressed store, hash-verified

483 assert colitems[0].path == p
484
485 def get_reported_items(self, hookrec: HookRecorder) -> List[Item]:
486 """Return pytest.Item instances reported by the pytest_collectreport hook"""
487 calls = hookrec.getcalls("pytest_collectreport")
488 return [
489 x
490 for call in calls
491 for x in call.report.result
492 if isinstance(x, pytest.Item)
493 ]
494
495 def test_collect_protocol_single_function(self, pytester: Pytester) -> None:
496 p = pytester.makepyfile("def test_func(): pass")

Calls 1

getcallsMethod · 0.80

Tested by

no test coverage detected