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": "test@test.com",
        "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)
