fix: add src to pythonpath for pytest

This commit is contained in:
Mike Kell 2025-06-13 02:01:25 +00:00
parent 4aaa975fbc
commit f1a89366e2
2 changed files with 16 additions and 0 deletions

3
requirements-dev.txt Normal file
View File

@ -0,0 +1,3 @@
httpx==0.28.1
pytest==8.2.0
pytest-asyncio==0.23.6

13
tests/test_health.py Normal file
View File

@ -0,0 +1,13 @@
import pytest
from httpx import AsyncClient, ASGITransport
from src.services.app.main import app
@pytest.mark.asyncio
async def test_healthz():
transport = ASGITransport(app=app, raise_app_exceptions=True)
async with AsyncClient(transport=transport, base_url="http://test") as ac:
resp = await ac.get("/healthz")
assert resp.status_code == 200
assert resp.json() == {"status": "pong"}