diff --git a/tests/conftest.py b/tests/conftest.py index ba0bd54..734a97b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -57,10 +57,17 @@ def client_with_isolation(isolated_data_root): def pytest_collection_modifyitems(config, items): if not os.environ.get("RUN_INTEGRATION"): - skip = pytest.mark.skip(reason="needs RUN_INTEGRATION=1") + skip_reason = "needs RUN_INTEGRATION=1" + remaining = [] + deselected = [] for item in items: if "integration" in item.keywords or "e2e" in item.keywords: - item.add_marker(skip) + deselected.append(item) + else: + remaining.append(item) + if deselected: + config.hook.pytest_deselected(items=deselected) + items[:] = remaining skip_no_integration = pytest.mark.skipif(