kin/tests/conftest.py

20 lines
925 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Shared pytest fixtures for Kin test suite."""
import pytest
from unittest.mock import patch
@pytest.fixture(autouse=True)
def _mock_check_claude_auth():
"""Авто-мок agents.runner.check_claude_auth для всех тестов.
run_pipeline() вызывает check_claude_auth() перед запуском агентов.
Без мока тесты, использующие side_effect-очереди для subprocess.run,
ломаются: первый вызов (auth-check) потребляет элемент очереди.
Тесты TestCheckClaudeAuth (test_runner.py) НЕ затрагиваются:
они вызывают check_claude_auth через напрямую импортированную ссылку
(bound at module load time), а не через agents.runner.check_claude_auth.
"""
with patch("agents.runner.check_claude_auth"):
yield