kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-18 01:00:15 +02:00
parent 2bc0146189
commit 8b409fd7db
2 changed files with 39 additions and 0 deletions

View file

@ -11,6 +11,18 @@ def _set_kin_secret_key(monkeypatch):
monkeypatch.setenv("KIN_SECRET_KEY", Fernet.generate_key().decode())
@pytest.fixture(autouse=True)
def _clear_kin_noninteractive(monkeypatch):
"""Ensure KIN_NONINTERACTIVE is not inherited from parent process.
Tests that need it explicitly set it via @patch.dict("os.environ", {"KIN_NONINTERACTIVE": "1"}).
Without this fixture, KIN_NONINTERACTIVE=1 (set by web API when launching agent subprocesses)
leaks into the test environment and causes _run_claude to add --dangerously-skip-permissions
even when noninteractive=False.
"""
monkeypatch.delenv("KIN_NONINTERACTIVE", raising=False)
@pytest.fixture(autouse=True)
def _mock_check_claude_auth():
"""Авто-мок agents.runner.check_claude_auth для всех тестов.