MCPcopy
hub / github.com/aio-libs/aiohttp / test_wait_for

Function test_wait_for

tests/test_client_functional.py:416–426  ·  view source on GitHub ↗
(create_app_and_client, loop)

Source from the content-addressed store, hash-verified

414
415@pytest.mark.run_loop
416def test_wait_for(create_app_and_client, loop):
417 @asyncio.coroutine
418 def handler(request):
419 return web.Response(body=b'OK')
420
421 app, client = yield from create_app_and_client()
422 app.router.add_route('GET', '/', handler)
423 resp = yield from asyncio.wait_for(client.get('/'), 10, loop=loop)
424 assert resp.status == 200
425 txt = yield from resp.text()
426 assert txt == 'OK'
427
428
429@pytest.mark.run_loop

Callers

nothing calls this directly

Calls 4

create_app_and_clientFunction · 0.85
add_routeMethod · 0.45
getMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected