Skip to content

Commit

Permalink
Report dependency fixes (#45)
Browse files Browse the repository at this point in the history
* add env to make file

* ignore xml for pytest report

* init config and add asyncio
  • Loading branch information
RusticPotatoes authored May 25, 2024
1 parent 5247b2b commit 10e2736
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
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 10e2736

Please sign in to comment.