def _create_aiohttp_client_session(): loop = asyncio.get_event_loop() resolver = DNS_SERVICE.aiohttp_resolver(loop=loop) request_timeout = 30 session = aiohttp_client_session( resolver=resolver, timeout=request_timeout) return session
async def _async_test_dns_service_aiohttp(url): resolver = DNS_SERVICE.aiohttp_resolver() async with aiohttp_client_session(resolver=resolver) as session: async with session.get(url) as resp: assert resp.status == 200