From 2dbabbb5975f60d8021b455774f0a5de550eb3e4 Mon Sep 17 00:00:00 2001 From: T2K-Felix <125863421+felixT2K@users.noreply.github.com> Date: Sat, 30 Nov 2024 14:17:32 +0100 Subject: [PATCH] [misc] Replace in deprecation dropped httpx.AsyncClient app arg (#1802) --- api/tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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