@@ -42,7 +42,11 @@ class TestContentIndexThinkingAndText:
4242 async def test_thinking_then_text_content_index (self ):
4343 provider = FauxProvider ()
4444 provider .set_responses (
45- [faux_assistant_message ([faux_thinking ("let me think" ), faux_text ("answer" )])]
45+ [
46+ faux_assistant_message (
47+ [faux_thinking ("let me think" ), faux_text ("answer" )]
48+ )
49+ ]
4650 )
4751
4852 stream = await provider .stream (_make_model (), [])
@@ -55,18 +59,14 @@ async def test_thinking_then_text_content_index(self):
5559 ]
5660 assert len (thinking_events ) >= 3
5761 for e in thinking_events :
58- assert (
59- e .content_index == 0
60- ), f"{ e .type } had content_index={ e .content_index } "
62+ assert e .content_index == 0 , f"{ e .type } had content_index={ e .content_index } "
6163
6264 text_events = [
6365 e for e in events if e .type in ("text_start" , "text_delta" , "text_end" )
6466 ]
6567 assert len (text_events ) >= 3
6668 for e in text_events :
67- assert (
68- e .content_index == 1
69- ), f"{ e .type } had content_index={ e .content_index } "
69+ assert e .content_index == 1 , f"{ e .type } had content_index={ e .content_index } "
7070
7171
7272class TestContentIndexTextAndToolCall :
@@ -77,7 +77,10 @@ async def test_text_then_tool_content_index(self):
7777 provider .set_responses (
7878 [
7979 faux_assistant_message (
80- [faux_text ("searching" ), faux_tool_call ("search" , {"q" : "test" }, id = "tc-1" )],
80+ [
81+ faux_text ("searching" ),
82+ faux_tool_call ("search" , {"q" : "test" }, id = "tc-1" ),
83+ ],
8184 stop_reason = "tool_use" ,
8285 )
8386 ]
@@ -91,9 +94,7 @@ async def test_text_then_tool_content_index(self):
9194 ]
9295 assert len (text_events ) >= 3
9396 for e in text_events :
94- assert (
95- e .content_index == 0
96- ), f"{ e .type } had content_index={ e .content_index } "
97+ assert e .content_index == 0 , f"{ e .type } had content_index={ e .content_index } "
9798
9899 tool_events = [
99100 e
@@ -102,6 +103,4 @@ async def test_text_then_tool_content_index(self):
102103 ]
103104 assert len (tool_events ) >= 3
104105 for e in tool_events :
105- assert (
106- e .content_index == 1
107- ), f"{ e .type } had content_index={ e .content_index } "
106+ assert e .content_index == 1 , f"{ e .type } had content_index={ e .content_index } "
0 commit comments