File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,11 @@ async def test_idle_session_cleanup():
280280
281281 async with manager .run ():
282282 # Mock the app.run to prevent it from doing anything
283- app .run = AsyncMock (side_effect = lambda * args , ** kwargs : anyio .sleep (float ("inf" )))
283+
284+ async def mock_infinite_sleep (* args : Any , ** kwargs : Any ) -> None :
285+ await anyio .sleep (float ("inf" ))
286+
287+ app .run = AsyncMock (side_effect = mock_infinite_sleep )
284288
285289 # Create mock transports directly to simulate sessions
286290 # We'll bypass the HTTP layer for simplicity
@@ -323,7 +327,11 @@ async def test_cleanup_only_above_threshold():
323327 )
324328
325329 async with manager .run ():
326- app .run = AsyncMock (side_effect = lambda * args , ** kwargs : anyio .sleep (float ("inf" )))
330+
331+ async def mock_infinite_sleep (* args : Any , ** kwargs : Any ) -> None :
332+ await anyio .sleep (float ("inf" ))
333+
334+ app .run = AsyncMock (side_effect = mock_infinite_sleep )
327335
328336 # Create just one session (below threshold)
329337 transport = MagicMock (spec = StreamableHTTPServerTransport )
You can’t perform that action at this time.
0 commit comments