diff --git a/tests/hermes_cli/test_runtime_provider_resolution.py b/tests/hermes_cli/test_runtime_provider_resolution.py index 198fd0488bda..70760224887e 100644 --- a/tests/hermes_cli/test_runtime_provider_resolution.py +++ b/tests/hermes_cli/test_runtime_provider_resolution.py @@ -303,6 +303,14 @@ def test_resolve_runtime_provider_codex(monkeypatch): def test_resolve_runtime_provider_qwen_oauth(monkeypatch): monkeypatch.setattr(rp, "resolve_provider", lambda *a, **k: "qwen-oauth") + # This test exercises the singleton Qwen credential resolver, not the + # higher-priority credential pool. Keep it independent of any real + # ~/.qwen credentials present under the HOME preserved by the test runner. + monkeypatch.setattr( + rp, + "load_pool", + lambda _provider: SimpleNamespace(has_credentials=lambda: False), + ) monkeypatch.setattr( rp, "resolve_qwen_runtime_credentials", @@ -363,6 +371,14 @@ def test_qwen_oauth_auto_fallthrough_on_auth_failure(monkeypatch): from hermes_cli.auth import AuthError monkeypatch.setattr(rp, "resolve_provider", lambda *a, **k: "qwen-oauth") + # A real Qwen pool entry would correctly win before the singleton resolver + # and prevent this auth-failure branch from running. Force the empty-pool + # precondition that this test is specifically asserting. + monkeypatch.setattr( + rp, + "load_pool", + lambda _provider: SimpleNamespace(has_credentials=lambda: False), + ) monkeypatch.setattr( rp, "resolve_qwen_runtime_credentials",