MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / test_socket_timeout

Function test_socket_timeout

tests/test_client_functional.py:4727–4739  ·  view source on GitHub ↗
(aiohttp_client: Any)

Source from the content-addressed store, hash-verified

4725
4726
4727async def test_socket_timeout(aiohttp_client: Any) -> None:
4728 async def handler(request):
4729 await asyncio.sleep(5)
4730 return web.Response()
4731
4732 app = web.Application()
4733 app.add_routes([web.get("/", handler)])
4734
4735 timeout = aiohttp.ClientTimeout(sock_read=0.1)
4736 client = await aiohttp_client(app, timeout=timeout)
4737
4738 with pytest.raises(SocketTimeoutError):
4739 await client.get("/")
4740
4741
4742async def test_read_timeout_closes_connection(aiohttp_client: AiohttpClient) -> None:

Callers

nothing calls this directly

Calls 3

add_routesMethod · 0.95
aiohttp_clientFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected