human cleanup

This commit is contained in:
2026-03-09 22:36:04 -04:00
parent 3defce1365
commit 488912a991
8 changed files with 377 additions and 329 deletions
-30
View File
@@ -1,30 +0,0 @@
import os
import pytest
from dotenv import load_dotenv
# Try to load .env.test first, fallback to .env
env_test_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), '.env.test')
env_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), '.env')
if os.path.exists(env_test_path):
load_dotenv(env_test_path)
print("✓ Loaded environment variables from .env.test")
elif os.path.exists(env_path):
load_dotenv(env_path)
print("✓ Loaded environment variables from .env")
@pytest.fixture(autouse=True, scope="session")
def verify_env_loaded():
"""Verify critical environment variables are loaded before tests run"""
required_vars = [
"DISCORD_TOKEN",
"OPENAI_API_ENDPOINT",
"IMAGE_GEN_ENDPOINT",
"IMAGE_EDIT_ENDPOINT"
]
missing_vars = [var for var in required_vars if var not in os.environ]
if missing_vars:
pytest.fail(f"Missing required environment variables: {', '.join(missing_vars)}")
yield