| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import pathlib |
| 4 |
import pytest |
| 5 |
|
| 6 |
INTEGRATION_DIR = pathlib.Path(__file__).resolve().parent / "examples" / "integrations" |
| 7 |
|
| 8 |
|
| 9 |
def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item]) -> None: |
| 10 |
for item in items: |
| 11 |
# item.path is pathlib.Path on modern pytest; fall back for older |
| 12 |
p = pathlib.Path(str(getattr(item, "path", item.fspath))).resolve() |
| 13 |
if INTEGRATION_DIR in p.parents: |
| 14 |
item.add_marker(pytest.mark.integration) |