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

Function pytest_collection_modifyitems

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

Source from the content-addressed store, hash-verified

479
480
481def pytest_collection_modifyitems(items: list[nodes.Item], config: Config) -> None:
482 deselect_prefixes = tuple(config.getoption("deselect") or [])
483 if not deselect_prefixes:
484 return
485
486 remaining = []
487 deselected = []
488 for colitem in items:
489 if colitem.nodeid.startswith(deselect_prefixes):
490 deselected.append(colitem)
491 else:
492 remaining.append(colitem)
493
494 if deselected:
495 config.hook.pytest_deselected(items=deselected)
496 items[:] = remaining
497
498
499class FSHookProxy:

Callers

nothing calls this directly

Calls 3

getoptionMethod · 0.80
appendMethod · 0.80
pytest_deselectedMethod · 0.80

Tested by

no test coverage detected