Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
sync:
uv sync

# Run tests with coverage
# Run tests with coverage (excludes integration tests)
# Usage: make test
# To run a specific test: make test TEST=test_file.py::test_function
test:
uv run pytest --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test/)
uv run pytest -m "not integration" --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test/)

test-integration:
uv run pytest -m integration --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test/)

# Run linter
lint:
Expand All @@ -30,7 +33,8 @@ check: lint fmt test
doc:
@echo "Available targets:"
@echo " sync - Install/update dependencies"
@echo " test - Run tests with coverage (use TEST=path.to.test to run specific tests)"
@echo " test - Run tests with coverage (excludes integration tests, use TEST=path.to.test to run specific tests)"
@echo " test-integration - Run integration tests with coverage"
@echo " lint - Run linter checks"
@echo " fmt - Format code"
@echo " fix - Fix fixable linting and formatting issues"
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,15 @@ testpaths = [
"integration",
]

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

asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"

markers = [
"integration: marks tests as integration tests requiring a running OpenFGA server",
]

[tool.mypy]
python_version = "3.10"
packages = "openfga_sdk"
Expand Down
3 changes: 2 additions & 1 deletion test/error_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
],
}


@pytest.mark.integration
@pytest.mark.asyncio
class TestErrorIntegration:
"""Integration tests for enhanced error handling."""
Expand Down Expand Up @@ -424,6 +424,7 @@ async def test_error_details_not_lost_in_traceback(self, fga_client):


# Sync version of tests
@pytest.mark.integration
class TestErrorIntegrationSync:
"""Synchronous integration tests for enhanced error handling."""

Expand Down