20 lines
392 B
Python
20 lines
392 B
Python
import pytest
|
|
import asyncio
|
|
from httpx import AsyncClient, ASGITransport
|
|
|
|
from app.main import app
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def event_loop():
|
|
loop = asyncio.new_event_loop()
|
|
yield loop
|
|
loop.close()
|
|
|
|
|
|
@pytest.fixture
|
|
async def client():
|
|
transport = ASGITransport(app=app)
|
|
async with AsyncClient(transport=transport, base_url="http://test") as c:
|
|
yield c
|