mirror of https://github.com/tqdm/tqdm.git
Merge pull request #1595 from hroncok/py3.13-await-aclose
Avoid Python 3.13+ RuntimeWarning: coroutine method 'aclose' of 'acount' was never awaited
This commit is contained in:
commit
951a2ba8d8
|
@ -48,10 +48,14 @@ async def test_generators(capsys):
|
|||
_, err = capsys.readouterr()
|
||||
assert '9it' in err
|
||||
|
||||
with tqdm(acount(), desc="async_counter") as pbar:
|
||||
async for i in pbar:
|
||||
if i >= 8:
|
||||
break
|
||||
acounter = acount()
|
||||
try:
|
||||
with tqdm(acounter, desc="async_counter") as pbar:
|
||||
async for i in pbar:
|
||||
if i >= 8:
|
||||
break
|
||||
finally:
|
||||
await acounter.aclose()
|
||||
_, err = capsys.readouterr()
|
||||
assert '9it' in err
|
||||
|
||||
|
|
Loading…
Reference in New Issue