From f1a89366e22036e12f4096fc69989500e3e4ff86 Mon Sep 17 00:00:00 2001 From: Mike Kell Date: Fri, 13 Jun 2025 02:01:25 +0000 Subject: [PATCH] fix: add src to pythonpath for pytest --- requirements-dev.txt | 3 +++ tests/test_health.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 requirements-dev.txt create mode 100644 tests/test_health.py diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..32ceee3 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,3 @@ +httpx==0.28.1 +pytest==8.2.0 +pytest-asyncio==0.23.6 diff --git a/tests/test_health.py b/tests/test_health.py new file mode 100644 index 0000000..512cb90 --- /dev/null +++ b/tests/test_health.py @@ -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"}