You've already forked request-coalescing-py
mirror of
https://github.com/hexolan/request-coalescing-py.git
synced 2026-03-26 18:21:16 +00:00
initial commit
This commit is contained in:
24
tests/conftest.py
Normal file
24
tests/conftest.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import pytest
|
||||
from fastapi import FastAPI
|
||||
from httpx import AsyncClient
|
||||
from asgi_lifespan import LifespanManager
|
||||
|
||||
from request_coalescing_py.main import app
|
||||
from request_coalescing_py.models import Item
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def anyio_backend() -> str:
|
||||
return "asyncio"
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
async def test_app() -> FastAPI:
|
||||
async with LifespanManager(app) as manager:
|
||||
yield manager.app
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
async def client(test_app) -> AsyncClient:
|
||||
async with AsyncClient(app=test_app, base_url="http://test") as client:
|
||||
yield client
|
||||
Reference in New Issue
Block a user