This commit is contained in:
Mikan
2026-06-20 19:13:05 +03:00
parent 32575e217e
commit 8514c63ec6
193 changed files with 22105 additions and 11660 deletions

25
tests/conftest.py Normal file
View File

@@ -0,0 +1,25 @@
"""Pytest config + fixtures."""
from __future__ import annotations
import os
# Use test env vars before importing anything app-related
os.environ.setdefault("DATABASE_URL", "postgresql+asyncpg://airpg:airpg@localhost:5432/airpg_test")
os.environ.setdefault("QDRANT_URL", "http://localhost:6333")
os.environ.setdefault("LLM_API_URL", "") # forces MockLlmClient
os.environ.setdefault("SECRET_KEY", "test-secret-key-32-bytes-long-required")
os.environ.setdefault("DEBUG", "true")
import pytest
def pytest_collection_modifyitems(config, items):
"""Auto-mark async tests with pytest.mark.asyncio."""
for item in items:
if "asyncio" in item.keywords:
continue
# If the test function is a coroutine function, auto-add the asyncio marker
import inspect
if inspect.iscoroutinefunction(item.function):
item.add_marker(pytest.mark.asyncio)