File tree Expand file tree Collapse file tree
unit/pydantic_ai_lightspeed/llamastack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ async def test_stream_interrupt_full_round_trip(
3434 """Full lifecycle: register, interrupt, then verify deregistration."""
3535 # test_config loads configuration so @authorize on the handler can resolve.
3636 _ = test_config
37+
3738 async def pending_stream () -> None :
3839 await asyncio .sleep (10 )
3940
Original file line number Diff line number Diff line change 33# pylint: disable=protected-access
44
55import json
6+ from collections .abc import AsyncGenerator
67from typing import Any
78
89import httpx
@@ -45,7 +46,7 @@ class TestAsyncByteStream:
4546 async def test_iterates_chunks (self ) -> None :
4647 """Test that _AsyncByteStream yields all chunks from the wrapped generator."""
4748
48- async def gen ():
49+ async def gen () -> AsyncGenerator [ bytes , None ] :
4950 yield b"chunk1"
5051 yield b"chunk2"
5152 yield b"chunk3"
@@ -59,7 +60,7 @@ async def gen():
5960 async def test_empty_generator (self ) -> None :
6061 """Test that _AsyncByteStream handles an empty generator gracefully."""
6162
62- async def gen ():
63+ async def gen () -> AsyncGenerator [ bytes , None ] :
6364 return
6465 yield # pragma: no cover
6566
@@ -134,7 +135,7 @@ async def test_streaming_request(
134135 content = json .dumps (body ).encode ("utf-8" ),
135136 )
136137
137- async def mock_stream_result ():
138+ async def mock_stream_result () -> AsyncGenerator [ dict [ str , int ], None ] :
138139 yield {"chunk" : 1 }
139140 yield {"chunk" : 2 }
140141
@@ -317,7 +318,7 @@ async def test_produces_sse_format(
317318 ) -> None :
318319 """Test that streaming responses produce SSE-formatted byte chunks."""
319320
320- async def mock_stream ():
321+ async def mock_stream () -> AsyncGenerator [ dict [ str , str ], None ] :
321322 yield {"delta" : "hello" }
322323 yield {"delta" : "world" }
323324
You can’t perform that action at this time.
0 commit comments