File tree Expand file tree Collapse file tree
tests/integrations/pydantic_ai Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -523,8 +523,8 @@ async def test_agent_run_stream_events(
523523 if PYDANTIC_VERSION > (2 ,):
524524 async with test_agent .run_stream_events (
525525 ["Message demonstrating the absence of truncation." , "Test input" ]
526- ) as events :
527- async for _ in events :
526+ ) as stream_events :
527+ async for _ in stream_events :
528528 pass
529529 else :
530530 async for _ in test_agent .run_stream_events (
@@ -551,8 +551,13 @@ async def test_agent_run_stream_events(
551551 else :
552552 events = capture_events ()
553553
554- async for _ in test_agent .run_stream_events ("Test input" ):
555- pass
554+ if PYDANTIC_VERSION > (2 ,):
555+ async with test_agent .run_stream_events ("Test input" ) as stream_events :
556+ async for _ in stream_events :
557+ pass
558+ else :
559+ async for _ in test_agent .run_stream_events ("Test input" ):
560+ pass
556561
557562 (transaction ,) = events
558563
You can’t perform that action at this time.
0 commit comments