From a2a6a4f8b3b569bd8de07735bf5dc12df40366e0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 5 Aug 2024 10:28:12 +0200 Subject: Adding upstream version 4.66.5. Signed-off-by: Daniel Baumann --- tests/tests_asyncio.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/tests_asyncio.py') 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 -- cgit v1.2.3