Skip to content

Commit 6586c4f

Browse files
committed
Gate ES-backed contract tests
Mark the local Elasticsearch-backed API contract suite as integration and skip it unless NAMERES_RUN_INTEGRATION_TESTS=1 is set.
1 parent b32874d commit 6586c4f

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ testpaths = ["test"]
124124

125125
# Markers
126126
markers = [
127+
"integration: marks tests that require external services",
127128
"unit",
128129
"performance"
129130
]

test/test_api_contract.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717

1818

1919
ROOT = Path(__file__).resolve().parents[1]
20+
RUN_INTEGRATION_TESTS = os.getenv("NAMERES_RUN_INTEGRATION_TESTS") == "1"
21+
22+
pytestmark = [
23+
pytest.mark.integration,
24+
pytest.mark.skipif(
25+
not RUN_INTEGRATION_TESTS,
26+
reason="set NAMERES_RUN_INTEGRATION_TESTS=1 to run local Elasticsearch-backed API contract tests",
27+
),
28+
]
2029

2130

2231
def _free_port() -> int:

0 commit comments

Comments
 (0)