This commit is contained in:
2026-01-29 19:53:36 +01:00
parent 1bda2013bb
commit a9708b33e2
27 changed files with 3745 additions and 4 deletions

27
tests/conftest.py Normal file
View File

@@ -0,0 +1,27 @@
"""Pytest configuration and fixtures."""
import os
from typing import Generator
import pytest
from aegis_gitea_mcp.config import reset_settings
from aegis_gitea_mcp.audit import reset_audit_logger
@pytest.fixture(autouse=True)
def reset_globals() -> Generator[None, None, None]:
"""Reset global singletons between tests."""
yield
reset_settings()
reset_audit_logger()
@pytest.fixture
def mock_env(monkeypatch: pytest.MonkeyPatch) -> None:
"""Set up mock environment variables for testing."""
monkeypatch.setenv("GITEA_URL", "https://gitea.example.com")
monkeypatch.setenv("GITEA_TOKEN", "test-token-12345")
monkeypatch.setenv("MCP_HOST", "0.0.0.0")
monkeypatch.setenv("MCP_PORT", "8080")
monkeypatch.setenv("LOG_LEVEL", "DEBUG")