import os import sys from pathlib import Path BACKEND_ROOT = Path(__file__).resolve().parents[1] if str(BACKEND_ROOT) not in sys.path: sys.path.insert(0, str(BACKEND_ROOT)) # Tests import app.config at module import time. Provide a harmless default # DB URL so collection doesn't depend on the caller's shell env. os.environ.setdefault("DATABASE_URL", "sqlite+aiosqlite:///./test.db")