(config: "Config", items: "List[Node]")
| 96 | |
| 97 | |
| 98 | def 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() |
nothing calls this directly
no test coverage detected