Skip to content

Commit

Permalink
[misc] Replace in deprecation dropped httpx.AsyncClient app arg (#1802)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixT2K authored Nov 30, 2024
1 parent 2711df4 commit 2dbabbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest_asyncio
import requests
from httpx import AsyncClient
from httpx import ASGITransport, AsyncClient

from app.main import app

Expand All @@ -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


Expand Down

0 comments on commit 2dbabbb

Please sign in to comment.