diff --git a/api/tests/conftest.py b/api/tests/conftest.py index dedfcae2b2..d5f5781f4f 100644 --- a/api/tests/conftest.py +++ b/api/tests/conftest.py @@ -1,6 +1,6 @@ import pytest_asyncio import requests -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from app.main import app @@ -27,7 +27,7 @@ def mock_txt_file(tmpdir_factory): @pytest_asyncio.fixture(scope="function") async def test_app_asyncio(): # for httpx>=20, follow_redirects=True (cf. https://github.com/encode/httpx/releases/tag/0.20.0) - async with AsyncClient(app=app, base_url="http://test", follow_redirects=True) as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test", follow_redirects=True) as ac: yield ac # testing happens here