From 6b7da117498d8d16f2d9992b0117ddbb6e3da154 Mon Sep 17 00:00:00 2001 From: stepanov1975 <9785479+stepanov1975@users.noreply.github.com> Date: Sat, 16 May 2026 18:37:12 +0000 Subject: [PATCH] test: isolate API server env in gateway tests (cherry picked from commit 3d585f8db5b5d3965efa50ab12f9a5b8608cc21c) --- tests/conftest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 0514702546b..7f68298c7ac 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -290,6 +290,15 @@ _HERMES_BEHAVIORAL_VARS = frozenset({ "WECOM_HOME_CHANNEL", "WECOM_HOME_CHANNEL_THREAD_ID", "WECOM_HOME_CHANNEL_NAME", + # API server bind/auth settings are common in local gateway profiles and + # change adapter defaults plus load_gateway_config() enablement. Tests that + # need them set opt in explicitly with monkeypatch. + "API_SERVER_ENABLED", + "API_SERVER_HOST", + "API_SERVER_PORT", + "API_SERVER_KEY", + "API_SERVER_CORS_ORIGINS", + "API_SERVER_MODEL_NAME", # Platform gating — set by load_gateway_config() as a side effect when # a config.yaml is present, so individual test bodies that call the # loader leak these values into later tests in the same process.