MCPcopy Index your code
hub / github.com/wechaty/python-wechaty / test_gather_tasks_with_n_concurrency

Function test_gather_tasks_with_n_concurrency

tests/utils_test.py:17–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16@pytest.mark.asyncio
17async def test_gather_tasks_with_n_concurrency():
18 tasks = [asyncio.create_task(number_task(i)) for i in range(1000)]
19 sum_value = (0 + 999) * 1000 / 2
20 result = await gather_with_concurrency(10, tasks)
21 assert sum_value == sum(result), 'the final sum value is not correct'
22
23
24def test_fetch_metadata():

Callers

nothing calls this directly

Calls 2

gather_with_concurrencyFunction · 0.90
number_taskFunction · 0.85

Tested by

no test coverage detected