From 0d3ad193d6cc235213489f509e26760ccb3722a1 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 14 Jul 2026 03:11:19 -0700 Subject: [PATCH] fix(tests): patch catalog urlopen wrapper in gemini probe tests (#64318) test_probe_sends_client_context_to_gemini and test_probe_omits_gemini_client_context_for_other_providers (added in b8eb89f5c) patch hermes_cli.models.urllib.request.urlopen, but probe_api_models routes requests through the _urlopen_model_catalog_request wrapper (open_credentialed_url from the urllib_security hardening), so the mock is never invoked and mock_urlopen.call_args is None -> TypeError. Every CI run on main and every PR has been failing test slice 7/8 on these two tests. Point the patches at _urlopen_model_catalog_request, the same target every sibling test in TestProbeApiModelsUserAgent already uses. 89/89 tests in the file now pass. --- tests/hermes_cli/test_model_validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hermes_cli/test_model_validation.py b/tests/hermes_cli/test_model_validation.py index 9e08831701e3..cfff3080ebfa 100644 --- a/tests/hermes_cli/test_model_validation.py +++ b/tests/hermes_cli/test_model_validation.py @@ -949,7 +949,7 @@ class TestProbeApiModelsUserAgent: body = b'{"data":[]}' with patch( - "hermes_cli.models.urllib.request.urlopen", + "hermes_cli.models._urlopen_model_catalog_request", return_value=self._make_mock_response(body), ) as mock_urlopen: probe_api_models( @@ -965,7 +965,7 @@ class TestProbeApiModelsUserAgent: body = b'{"data":[]}' with patch( - "hermes_cli.models.urllib.request.urlopen", + "hermes_cli.models._urlopen_model_catalog_request", return_value=self._make_mock_response(body), ) as mock_urlopen: probe_api_models("provider-key", "https://api.example.com/v1")