Skip to content

Commit 82dc122

Browse files
committed
fix(test): narrow handle() result to Task before await (pyright)
handle() returns Task[ToolResult] | ToolResult; assert isinstance Task before awaiting, matching the other dedup tests, so pyright's check job passes.
1 parent 8a6fca9 commit 82dc122

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/core/test_toolset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,11 @@ async def test_begin_end_step():
458458

459459
# A fresh (non-duplicate) call this step is captured by end_step() and does
460460
# not trip cross-step dedup, since only ToolA was seen previously.
461-
await ts.handle(ToolCall(id="b1", function=ToolCall.FunctionBody(name="ToolB", arguments="{}")))
461+
result = ts.handle(
462+
ToolCall(id="b1", function=ToolCall.FunctionBody(name="ToolB", arguments="{}"))
463+
)
464+
assert isinstance(result, asyncio.Task)
465+
await result
462466
assert ts.end_step() == [("ToolB", "{}")]
463467
assert ts.dedup_triggered is False
464468

0 commit comments

Comments
 (0)