diff --git a/tests/test_service.py b/tests/test_service.py index bf88fc7f..5358a36c 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -2,15 +2,19 @@ from typing import Any import pytest -from fastapi.testclient import TestClient +from httpx import ASGITransport, AsyncClient from scanspec.service import PointsFormat, PointsRequest, app from scanspec.specs import Line @pytest.fixture -def client() -> TestClient: - return TestClient(app) +async def async_client(): + """Fixture to create a FastAPI test client.""" + async with AsyncClient( + transport=ASGITransport(app=app), base_url="http://test" + ) as async_test_client: + yield async_test_client # MIDPOINTS TEST(S) #