`asyncio.gather` API consistency with stdlib

- closes #1212
This commit is contained in:
MapleCCC 2021-07-31 04:33:05 +08:00 committed by GitHub
parent d0483be6c0
commit 223561a83b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ async def double(i):
@mark.asyncio
async def test_gather(capsys):
"""Test asyncio gather"""
res = await gather(list(map(double, range(30))))
res = await gather(*map(double, range(30)))
_, err = capsys.readouterr()
assert '30/30' in err
assert res == list(range(0, 30 * 2, 2))

View File

@ -68,7 +68,7 @@ class tqdm_asyncio(std_tqdm):
total=total, **tqdm_kwargs)
@classmethod
async def gather(cls, fs, *, loop=None, timeout=None, total=None, **tqdm_kwargs):
async def gather(cls, *fs, loop=None, timeout=None, total=None, **tqdm_kwargs):
"""
Wrapper for `asyncio.gather`.
"""