Skip to content

Commit

Permalink
init config and add asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
RusticPotatoes committed May 24, 2024
1 parent aa6e9af commit c4473e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# conftest.py
import asyncio
import os
import sys
from contextlib import asynccontextmanager
Expand All @@ -15,6 +16,7 @@

from src.core import server # noqa: E402
from src.core.fastapi.dependencies.session import get_session # noqa: E402
from src.core import config

# Create an async SQLAlchemy engine
engine = create_async_engine(
Expand Down Expand Up @@ -52,6 +54,7 @@ def app() -> FastAPI:
@pytest.fixture
@asynccontextmanager
async def custom_client(app: FastAPI):
config.send_queue = asyncio.Queue(maxsize=500)
base_url = "http://srv.test/"
transport = ASGITransport(app=app)
async with AsyncClient(transport=transport, base_url=base_url) as client:
Expand Down

0 comments on commit c4473e5

Please sign in to comment.