Pular para o conteúdo principal

conftest_2.py (Código)

from typing import AsyncIterable
from asgi_lifespan import LifespanManager
from fastapi import FastAPI
from httpx import AsyncClient
from pytest import fixture
from app import create_app  # isort:skip
async def app() -> AsyncIterable[FastAPI]:
    app = create_app()
    async with LifespanManager(app):
        yield app
async def client(app: FastAPI) -> AsyncIterable[AsyncClient]:
    async with AsyncClient(app=app, base_url='http://testserver') as client:
        yield client