Skip to content

Commit 1c16fe6

Browse files
authored
chore: mark integration tests (#248)
* chore: mark integration tests * fix: deselect integration tests in test Makefile command
1 parent 79eaaea commit 1c16fe6

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
sync:
55
uv sync
66

7-
# Run tests with coverage
7+
# Run tests with coverage (excludes integration tests)
88
# Usage: make test
99
# To run a specific test: make test TEST=test_file.py::test_function
1010
test:
11-
uv run pytest --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test/)
11+
uv run pytest -m "not integration" --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test/)
12+
13+
test-integration:
14+
uv run pytest -m integration --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test/)
1215

1316
# Run linter
1417
lint:
@@ -30,7 +33,8 @@ check: lint fmt test
3033
doc:
3134
@echo "Available targets:"
3235
@echo " sync - Install/update dependencies"
33-
@echo " test - Run tests with coverage (use TEST=path.to.test to run specific tests)"
36+
@echo " test - Run tests with coverage (excludes integration tests, use TEST=path.to.test to run specific tests)"
37+
@echo " test-integration - Run integration tests with coverage"
3438
@echo " lint - Run linter checks"
3539
@echo " fmt - Format code"
3640
@echo " fix - Fix fixable linting and formatting issues"

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,15 @@ testpaths = [
131131
"integration",
132132
]
133133

134-
addopts = "--cov=openfga_sdk --cov-report term-missing --cov-report xml --cov-report html"
134+
addopts = "--cov=openfga_sdk --cov-report term-missing --cov-report xml --cov-report html --strict-markers"
135135

136136
asyncio_mode = "strict"
137137
asyncio_default_fixture_loop_scope = "function"
138138

139+
markers = [
140+
"integration: marks tests as integration tests requiring a running OpenFGA server",
141+
]
142+
139143
[tool.mypy]
140144
python_version = "3.10"
141145
packages = "openfga_sdk"

test/error_integration_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
],
5454
}
5555

56-
56+
@pytest.mark.integration
5757
@pytest.mark.asyncio
5858
class TestErrorIntegration:
5959
"""Integration tests for enhanced error handling."""
@@ -424,6 +424,7 @@ async def test_error_details_not_lost_in_traceback(self, fga_client):
424424

425425

426426
# Sync version of tests
427+
@pytest.mark.integration
427428
class TestErrorIntegrationSync:
428429
"""Synchronous integration tests for enhanced error handling."""
429430

0 commit comments

Comments
 (0)