lis = []
async with httpx.AsyncClient() as client:
lis.append(
asyncio.ensure_future(get_info(client, "example/api1", "api_1"))
)
lis.append(asyncio.ensure_future(get_info(client, "example/api2", "api_2")))
lis.append(
asyncio.ensure_future(get_info(client, "example/api3", "api_3"))
)
infos = await asyncio.gather(*lis)
for info in infos:
data[info[0]] = info[1]
can anyone suggest to me how to mock the given code I’m pretty new to this Pytest?
New contributor
Akash Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.