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
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:

- name: Install dependencies
run: uv sync

- name: Run tests
run: uv run pytest tests/test_api.py -v -k "health"
run: uv run pytest tests/test_api.py -v -k "no_lifespan"
env:
PYTHONPATH: ${{ github.workspace }}
15 changes: 15 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
from fastapi.testclient import TestClient
from api.main import app

def test_health_no_lifespan():
from fastapi.testclient import TestClient
from fastapi import FastAPI

# create minimal app just for health test
test_app = FastAPI()

@test_app.get("/health")
def health():
return {"status": "ok"}

client = TestClient(test_app)
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}

@pytest.fixture(scope="module")
def client():
Expand Down
Loading