summaryrefslogtreecommitdiffstats
path: root/tests/tests_asyncio.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 08:28:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 08:28:12 +0000
commita2a6a4f8b3b569bd8de07735bf5dc12df40366e0 (patch)
treeb6eb187d592b9e73eba28b6e138b34dc17399cf0 /tests/tests_asyncio.py
parentAdding upstream version 4.66.4. (diff)
downloadtqdm-77a59ac63d7e349f6406c54bacba84f5f5a798e4.tar.xz
tqdm-77a59ac63d7e349f6406c54bacba84f5f5a798e4.zip
Adding upstream version 4.66.5.upstream/4.66.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/tests_asyncio.py')
-rw-r--r--tests/tests_asyncio.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/tests_asyncio.py b/tests/tests_asyncio.py
index bdef569..250e658 100644
--- a/tests/tests_asyncio.py
+++ b/tests/tests_asyncio.py
@@ -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