test: set env vars in conftest to fix import errors
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
import pytest
|
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
# Add backend to path so imports work without installing the package
|
# Set required env vars before any app imports
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
os.environ.setdefault("SECRET_KEY", "test-secret-key")
|
||||||
|
os.environ.setdefault("ANTHROPIC_API_KEY", "test-anthropic-key")
|
||||||
|
os.environ.setdefault("ADMIN_EMAIL", "admin@test.com")
|
||||||
|
os.environ.setdefault("ADMIN_PASSWORD", "testpassword")
|
||||||
|
os.environ.setdefault("DATABASE_URL", "postgresql+asyncpg://test:test@localhost:5432/test")
|
||||||
|
os.environ.setdefault("REDIS_URL", "redis://localhost:6379")
|
||||||
|
|
||||||
|
# Add backend to path
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|||||||
Reference in New Issue
Block a user