Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Cyprien <courtot.c@gmail.com>
Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com>
Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com>
Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: josephine-delas <57808586+josephine-delas@users.noreply.github.com>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Laure Hugo 2026-06-25 16:08:45 +02:00 committed by GitHub
parent 725d3a56ce
commit e607ccbb00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
242 changed files with 7372 additions and 1974 deletions

View file

@ -35,6 +35,7 @@ from vibe.core.config.harness_files import (
reset_harness_files_manager,
)
from vibe.core.llm.types import BackendLike
from vibe.core.utils import keyring as keyring_utils
class _EmptyKeyring(KeyringBackend):
@ -49,11 +50,11 @@ class _EmptyKeyring(KeyringBackend):
return None
def delete_password(self, service: str, username: str) -> None:
raise keyring.errors.PasswordDeleteError(username)
raise keyring.errors.PasswordDeleteError()
@pytest.fixture(autouse=True)
def _disable_os_keyring() -> Generator[None, None, None]:
def _disable_os_keyring(monkeypatch: pytest.MonkeyPatch) -> Generator[None, None, None]:
"""Keep the suite off the real OS keyring.
``resolve_api_key`` and ``VibeConfig._check_api_key`` now consult the keyring, so
@ -63,10 +64,13 @@ def _disable_os_keyring() -> Generator[None, None, None]:
behaviour opt in by patching ``keyring.get_password`` / ``set_password`` directly.
"""
original = keyring.get_keyring()
monkeypatch.setattr(keyring_utils, "_should_use_macos_security", lambda: False)
keyring.set_keyring(_EmptyKeyring())
keyring_utils.clear_api_key_keyring_cache()
try:
yield
finally:
keyring_utils.clear_api_key_keyring_cache()
keyring.set_keyring(original)
@ -181,6 +185,8 @@ def _mock_api_key(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("MISTRAL_API_KEY", "mock")
monkeypatch.setenv("ANTHROPIC_API_KEY", "mock")
monkeypatch.setenv("OPENAI_API_KEY", "mock")
monkeypatch.setenv("VERTEX_API_KEY", "mock")
monkeypatch.setenv("REASONING_API_KEY", "mock")
@pytest.fixture(autouse=True)
@ -303,6 +309,12 @@ def build_test_vibe_config(**kwargs) -> VibeConfig:
# Connectors trigger a real HTTP discovery on agent construction; off by
# default so tests don't pay for it. Connector tests pass enable_connectors=True.
kwargs.setdefault("enable_connectors", False)
# Use the lightweight test system prompt unless a test asks for a real one.
kwargs.setdefault("system_prompt_id", "tests")
# Keep the test prompt minimal: skip project-context discovery and prompt
# detail unless a test opts in.
kwargs.setdefault("include_project_context", False)
kwargs.setdefault("include_prompt_detail", False)
return VibeConfig(
session_logging=resolved_session_logging,
enable_update_checks=resolved_enable_update_checks,