mirror of https://github.com/tqdm/tqdm.git
Avoid Python 3.13+ RuntimeWarning: coroutine method 'aclose' of 'acount' was never awaited
See https://github.com/python/cpython/issues/117536#issuecomment-2036883124
This commit is contained in:
parent
025434544e
commit
2fbad6ad51
|
@ -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