From f4c0064d16c66adef14d33a934ceb53fbb894df4 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Fri, 26 Jun 2026 10:55:41 -0400 Subject: [PATCH] test(providers): force Anthropic fallback tests past cached imports (#4770) --- tests/test_issue4770_anthropic_oauth_detection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_issue4770_anthropic_oauth_detection.py b/tests/test_issue4770_anthropic_oauth_detection.py index 251c26f2..7262bcbd 100644 --- a/tests/test_issue4770_anthropic_oauth_detection.py +++ b/tests/test_issue4770_anthropic_oauth_detection.py @@ -1,6 +1,7 @@ """Regression tests for #4770 - Anthropic OAuth env vars in fallback detection.""" import builtins +import sys import api.config as config @@ -8,6 +9,8 @@ import api.config as config def _force_env_fallback(monkeypatch): """Force get_available_models() into the env-based fallback branch.""" real_import = builtins.__import__ + monkeypatch.delitem(sys.modules, "hermes_cli.auth", raising=False) + monkeypatch.delitem(sys.modules, "hermes_cli", raising=False) def fake_import(name, globals=None, locals=None, fromlist=(), level=0): if name in ("hermes_cli.models", "hermes_cli.auth"):