Skip to content

Commit

Permalink
Workaround httpx deprecation warning in fastapi
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondJoseph committed Aug 6, 2024
1 parent 42dbd06 commit cac4614
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) #
Expand Down

0 comments on commit cac4614

Please sign in to comment.