From 10e2736c6219f7e72edb61e624c3b4cfc59ad28b Mon Sep 17 00:00:00 2001 From: RusticPotatos <3542090+RusticPotatoes@users.noreply.github.com> Date: Sat, 25 May 2024 10:18:44 -0400 Subject: [PATCH] Report dependency fixes (#45) * add env to make file * ignore xml for pytest report * init config and add asyncio --- .gitignore | 3 ++- Makefile | 7 +++++++ tests/conftest.py | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6d3a1ca4..2a8d40b7 100644 --- a/.gitignore +++ b/.gitignore @@ -159,4 +159,5 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ -# .vscode/*.DS_Store +# .vscode/*.DS_Store +pytest_report.xml diff --git a/Makefile b/Makefile index 95205049..389d0d55 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,12 @@ for line in sys.stdin: endef export PRINT_HELP_PYSCRIPT +export ENV=DEV +export DATABASE_URL=mysql+aiomysql://root:root_bot_buster@localhost/playerdata +export KAFKA_HOST=localhost:9094 +export POOL_RECYCLE=60 +export POOL_TIMEOUT=30 + help: @python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) @@ -78,6 +84,7 @@ test-setup: pre-commit-setup## installs pytest singular package for local testin python3 -m pip install pytest python3 -m pip install requests python3 -m pip install hypothesis + python3 -m pip install pytest-asyncio requirements: ## installs all requirements python3 -m pip install -r requirements.txt diff --git a/tests/conftest.py b/tests/conftest.py index 92be3c94..be520586 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ # conftest.py +import asyncio import os import sys from contextlib import asynccontextmanager @@ -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( @@ -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: