From 5d957b4cc8aea7ad430de143c17211db2f3cd99d Mon Sep 17 00:00:00 2001 From: Stanley Kudrow Date: Mon, 11 Nov 2024 13:20:25 +0300 Subject: [PATCH] add some tests for the issue #165 --- tests/threadpool/test_open.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/threadpool/test_open.py b/tests/threadpool/test_open.py index 5e2c40a..497a403 100644 --- a/tests/threadpool/test_open.py +++ b/tests/threadpool/test_open.py @@ -48,9 +48,10 @@ async def test_file_async_context_aexit(): async def test_filetask_async_context_aexit(): async def _process_test_file(file_ctx, sleep_time: float = 1.0): nonlocal file_ref - async with file_ctx: + async with file_ctx as fp: file_ref = file_ctx._obj await asyncio.sleep(sleep_time) + await fp.read() cancel_time, sleep_time = 0.1, 10 assert cancel_time <= (sleep_time / 10)