MCPcopy Create free account
hub / github.com/psf/black / pytest_collection_modifyitems

Function pytest_collection_modifyitems

tests/optional.py:98–111  ·  view source on GitHub ↗
(config: "Config", items: "List[Node]")

Source from the content-addressed store, hash-verified

96
97
98def pytest_collection_modifyitems(config: "Config", items: "List[Node]") -> None:
99 store = config._store
100 all_possible_optional_markers = store[ALL_POSSIBLE_OPTIONAL_MARKERS]
101 enabled_optional_markers = store[ENABLED_OPTIONAL_MARKERS]
102
103 for item in items:
104 all_markers_on_test = {m.name for m in item.iter_markers()}
105 optional_markers_on_test = all_markers_on_test & all_possible_optional_markers
106 if not optional_markers_on_test or (
107 optional_markers_on_test & enabled_optional_markers
108 ):
109 continue
110 log.info("skipping non-requested optional", item)
111 item.add_marker(skip_mark(frozenset(optional_markers_on_test)))
112
113
114@lru_cache()

Callers

nothing calls this directly

Calls 1

skip_markFunction · 0.85

Tested by

no test coverage detected