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

Function pytest_collection_modifyitems

src/_pytest/main.py:404–419  ·  view source on GitHub ↗
(items: List[nodes.Item], config: Config)

Source from the content-addressed store, hash-verified

402
403
404def pytest_collection_modifyitems(items: List[nodes.Item], config: Config) -> None:
405 deselect_prefixes = tuple(config.getoption("deselect") or [])
406 if not deselect_prefixes:
407 return
408
409 remaining = []
410 deselected = []
411 for colitem in items:
412 if colitem.nodeid.startswith(deselect_prefixes):
413 deselected.append(colitem)
414 else:
415 remaining.append(colitem)
416
417 if deselected:
418 config.hook.pytest_deselected(items=deselected)
419 items[:] = remaining
420
421
422class FSHookProxy:

Callers

nothing calls this directly

Calls 3

appendMethod · 0.80
pytest_deselectedMethod · 0.80
getoptionMethod · 0.45

Tested by

no test coverage detected