Skip to content

Commit 59dd083

Browse files
committed
test: seed session owner before cleanup
1 parent fe0a371 commit 59dd083

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/server/test_streamable_http_manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import json
44
import logging
55
from collections.abc import Iterator
6-
from typing import Any
6+
from typing import Any, cast
77
from unittest.mock import AsyncMock, patch
88

99
import anyio
@@ -289,6 +289,10 @@ async def mock_receive():
289289

290290
assert session_id is not None, "Session ID not found in response headers"
291291

292+
# Seed the owner registry so this assertion verifies that the cleanup path
293+
# removes the session owner as well as the server instance.
294+
manager._session_owners[session_id] = cast(Any, None)
295+
292296
mock_serve.assert_called_once()
293297

294298
# At this point, mock_serve has completed, and the finally block in

0 commit comments

Comments
 (0)