(handler, host_addr, port)
| 365 | call_count = 0 |
| 366 | |
| 367 | async def start_server_side_effect(handler, host_addr, port): |
| 368 | nonlocal call_count |
| 369 | call_count += 1 |
| 370 | if call_count <= 2: |
| 371 | raise OSError("port in use") |
| 372 | return fake_server |
| 373 | |
| 374 | with patch("asyncio.start_server", side_effect=start_server_side_effect): |
| 375 | port = await host._find_available_port() |
nothing calls this directly
no outgoing calls
no test coverage detected