Here is my code
@pytest.mark.asyncio
async def test_async():
res = []
for file_id in range(100):
result = await get_files_async(file_id)
res.append(result)
assert res == [200 for _ in range(100)]
async def get_files_async(file_id):
kwargs = {"verify": False, "cert": (cert, key)}
resp = requests.request('GET', url, **kwargs)
return resp.status_code
The timing from pytest shows it takes 118 sec to finish, which is very close to the test that sends request to url in sequence. Is there any improvement that can speed up this test? Thanks.