From 5975d69ea59dbe518d3bbb0176c0666beb89ab97 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Wed, 29 Apr 2026 19:01:49 -0700 Subject: [PATCH] test(vertex-batches): set is_redirect=False on mocked retrieve response After dedaf74a5e, _async_retrieve_batch wraps the GET in async_safe_get, which inspects response.is_redirect. test_avertex_batch_prediction's MagicMock response left is_redirect unset, so it auto-generated a truthy mock, sent the redirect-follow loop into _extract_redirect_url, and httpx.URL().join() raised TypeError. Set is_redirect=False so the response is treated as terminal. --- tests/batches_tests/test_openai_batches_and_files.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/batches_tests/test_openai_batches_and_files.py b/tests/batches_tests/test_openai_batches_and_files.py index 0aed224c256..a64f208b3f1 100644 --- a/tests/batches_tests/test_openai_batches_and_files.py +++ b/tests/batches_tests/test_openai_batches_and_files.py @@ -557,6 +557,7 @@ async def test_avertex_batch_prediction(monkeypatch): mock_get_response = MagicMock() mock_get_response.json.return_value = mock_vertex_batch_response mock_get_response.status_code = 200 + mock_get_response.is_redirect = False mock_get_response.raise_for_status.return_value = None mock_get.return_value = mock_get_response