Skip to content

Commit 2c804eb

Browse files
wiggzzclaude
andcommitted
Fix pyright errors for private task group access in test
Add None check assertion and type: ignore for accessing private _tasks attribute on TaskGroup (needed to verify no leaked tasks). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0949bce commit 2c804eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/server/test_streamable_http_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ async def make_and_abandon_tool_call():
340340

341341
# Check for leaked tasks in the session manager's global task group
342342
await anyio.sleep(0.1)
343-
leaked = len(session_manager._task_group._tasks)
343+
assert session_manager._task_group is not None
344+
leaked = len(session_manager._task_group._tasks) # type: ignore[attr-defined]
344345

345346
assert leaked == 0, (
346347
f"Expected 0 lingering tasks but found {leaked}. Stateless request tasks are leaking after client disconnect."

0 commit comments

Comments
 (0)