Newer
Older
geekbrain_io_web / tests / conftest.py
import pytest
import os

@pytest.fixture(autouse=True)
def setup_env(monkeypatch):
    """Setup required environment variables for all tests."""
    env_vars = {
        "DATABASE_URL": "mysql+aiomysql://user:pass@localhost/db",
        "SMTP_HOST": "smtp.test.com",
        "SMTP_PORT": "587",
        "SMTP_USER": "[email protected]",
        "SMTP_PASSWORD": "password",
        "RECAPTCHA_SECRET": "secret",
        "RECAPTCHA_SITE_KEY": "site_key",
        "GITBUCKET_URL": "http://test.com/api",
        "CACHE_TTL": "300",
        "LOG_LEVEL": "INFO"
    }
    for key, value in env_vars.items():
        monkeypatch.setenv(key, value)