Skip to content

Commit f69a920

Browse files
Merge pull request #395 from soerenreichardt/exclusively-run-cloud-architecture-tests
Run cloud tests exclusively if option is set
2 parents 5bda540 + 6c70cd0 commit f69a920

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

graphdatascience/tests/integration/conftest.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,17 @@ def pytest_collection_modifyitems(config: Any, items: Any) -> None:
167167
if "model_store_location" in item.keywords:
168168
item.add_marker(skip_stored_models)
169169

170-
if not config.getoption("--include-cloud-architecture"):
171-
skip_on_prem = pytest.mark.skip(reason="need --include-cloud-architecture option to run")
170+
# `cloud-architecture` includes marked tests and excludes everything else
171+
if config.getoption("--include-cloud-architecture"):
172+
skip_on_prem = pytest.mark.skip(reason="not marked as `cloud-architecture`")
172173
for item in items:
173-
if "cloud_architecture" in item.keywords:
174+
if "cloud_architecture" not in item.keywords:
174175
item.add_marker(skip_on_prem)
176+
else:
177+
skip_cloud_architecture = pytest.mark.skip(reason="need --include-cloud-architecture option to run")
178+
for item in items:
179+
if "cloud_architecture" in item.keywords:
180+
item.add_marker(skip_cloud_architecture)
175181

176182
try:
177183
server_version = GraphDataScience(URI, auth=AUTH)._server_version

0 commit comments

Comments
 (0)