Skip to content

Commit

Permalink
add some tests for the issue Tinche#165
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Kudrow committed Nov 11, 2024
1 parent b355882 commit 5d957b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/threadpool/test_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5d957b4

Please sign in to comment.