feat: centralized environment handling, ensures ZEN_MCP_FORCE_ENV_OVERRIDE is honored correctly

fix: updated tests to override env variables they need instead of relying on the current values from .env
This commit is contained in:
Fahad
2025-10-04 14:28:56 +04:00
parent 4015e917ed
commit 2c534ac06e
24 changed files with 300 additions and 179 deletions

View File

@@ -35,6 +35,7 @@ async def test_chat_auto_mode_with_openai(monkeypatch):
with monkeypatch.context() as m:
m.setenv("DEFAULT_MODEL", env_updates["DEFAULT_MODEL"])
m.setenv("OPENAI_ALLOWED_MODELS", "gpt-5")
if env_updates["OPENAI_API_KEY"]:
m.setenv("OPENAI_API_KEY", env_updates["OPENAI_API_KEY"])
for key in keys_to_clear:
@@ -105,6 +106,7 @@ async def test_chat_openai_continuation(monkeypatch):
with monkeypatch.context() as m:
m.setenv("DEFAULT_MODEL", env_updates["DEFAULT_MODEL"])
m.setenv("OPENAI_ALLOWED_MODELS", "gpt-5")
if recording_mode:
m.setenv("OPENAI_API_KEY", env_updates["OPENAI_API_KEY"])
else: