Skip to content

Commit 3011e05

Browse files
committed
add VCR decorators to FileSearchTool integration tests
Tests will record HTTP interactions to cassettes on first run with API keys, then replay them in CI without needing keys.
1 parent 8286cd7 commit 3011e05

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/models/test_google.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3203,6 +3203,7 @@ def _generate_response_with_texts(response_id: str, texts: list[str]) -> Generat
32033203
)
32043204

32053205

3206+
@pytest.mark.vcr()
32063207
async def test_google_model_file_search_tool(allow_model_requests: None, google_provider: GoogleProvider):
32073208
"""Integration test for FileSearchTool with Google."""
32083209
from pydantic_ai.builtin_tools import FileSearchTool
@@ -3243,6 +3244,7 @@ async def test_google_model_file_search_tool(allow_model_requests: None, google_
32433244
await client.aio.file_search_stores.delete(name=store.name)
32443245

32453246

3247+
@pytest.mark.vcr()
32463248
async def test_google_model_file_search_tool_stream(allow_model_requests: None, google_provider: GoogleProvider):
32473249
"""Integration test for FileSearchTool streaming with Google."""
32483250
from pydantic_ai.builtin_tools import FileSearchTool

tests/models/test_openai_responses.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7436,6 +7436,7 @@ def get_meaning_of_life() -> int:
74367436
)
74377437

74387438

7439+
@pytest.mark.vcr()
74397440
async def test_openai_responses_model_file_search_tool(allow_model_requests: None, openai_api_key: str):
74407441
"""Integration test for FileSearchTool with OpenAI."""
74417442
from openai import AsyncOpenAI
@@ -7477,6 +7478,7 @@ async def test_openai_responses_model_file_search_tool(allow_model_requests: Non
74777478
await async_client.close()
74787479

74797480

7481+
@pytest.mark.vcr()
74807482
async def test_openai_responses_model_file_search_tool_stream(allow_model_requests: None, openai_api_key: str):
74817483
"""Integration test for FileSearchTool streaming with OpenAI."""
74827484
from openai import AsyncOpenAI

0 commit comments

Comments
 (0)