mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-06-30 18:33:18 +03:00
Fix asyncio tests
This commit is contained in:
parent
2c998b8448
commit
1891952dc4
|
@ -4,6 +4,7 @@ from aiohttp import web, test_utils
|
|||
from dependency_injector import containers, providers
|
||||
from dependency_injector.ext import aiohttp
|
||||
from pytest import fixture, mark
|
||||
from pytest_asyncio import fixture as aio_fixture
|
||||
|
||||
|
||||
async def index_view(_):
|
||||
|
@ -63,7 +64,7 @@ def app():
|
|||
return app
|
||||
|
||||
|
||||
@fixture
|
||||
@aio_fixture
|
||||
async def client(app):
|
||||
async with test_utils.TestClient(test_utils.TestServer(app)) as client:
|
||||
yield client
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from httpx import AsyncClient
|
||||
from pytest import fixture, mark
|
||||
from pytest_asyncio import fixture as aio_fixture
|
||||
|
||||
# Runtime import to avoid syntax errors in samples on Python < 3.5 and reach top-dir
|
||||
import os
|
||||
|
@ -16,7 +17,7 @@ sys.path.append(_SAMPLES_DIR)
|
|||
from wiringfastapi import web
|
||||
|
||||
|
||||
@fixture
|
||||
@aio_fixture
|
||||
async def async_client():
|
||||
client = AsyncClient(app=web.app, base_url="http://test")
|
||||
yield client
|
||||
|
|
Loading…
Reference in New Issue
Block a user