mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-04-13 05:34:23 +03:00
Fix compatibility with httpx v0.27.0
This commit is contained in:
parent
160b089875
commit
8cec99dc35
|
@ -3,7 +3,7 @@
|
|||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
from .application import app, container
|
||||
from .services import Service
|
||||
|
@ -11,7 +11,10 @@ from .services import Service
|
|||
|
||||
@pytest.fixture
|
||||
def client(event_loop):
|
||||
client = AsyncClient(app=app, base_url="http://test")
|
||||
client = AsyncClient(
|
||||
transport=ASGITransport(app=app),
|
||||
base_url="http://test",
|
||||
)
|
||||
yield client
|
||||
event_loop.run_until_complete(client.aclose())
|
||||
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
from fastapi_di_example import app, container, Service
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def client(event_loop):
|
||||
async with AsyncClient(app=app, base_url="http://test") as client:
|
||||
async with AsyncClient(
|
||||
transport=ASGITransport(app=app),
|
||||
base_url="http://test",
|
||||
) as client:
|
||||
yield client
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
from giphynavigator.application import app
|
||||
from giphynavigator.giphy import GiphyClient
|
||||
|
@ -11,7 +11,10 @@ from giphynavigator.giphy import GiphyClient
|
|||
|
||||
@pytest.fixture
|
||||
async def client():
|
||||
async with AsyncClient(app=app, base_url="http://test") as client:
|
||||
async with AsyncClient(
|
||||
transport=ASGITransport(app=app),
|
||||
base_url="http://test",
|
||||
) as client:
|
||||
yield client
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from httpx import AsyncClient
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
from pytest import fixture, mark
|
||||
from pytest_asyncio import fixture as aio_fixture
|
||||
|
||||
|
@ -19,7 +19,7 @@ from wiringfastapi import web
|
|||
|
||||
@aio_fixture
|
||||
async def async_client():
|
||||
client = AsyncClient(app=web.app, base_url="http://test")
|
||||
client = AsyncClient(transport=ASGITransport(app=web.app), base_url="http://test")
|
||||
yield client
|
||||
await client.aclose()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user