mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
GH-96764: rewrite asyncio.wait_for
to use asyncio.timeout
(#98518)
Changes `asyncio.wait_for` to use `asyncio.timeout` as its underlying implementation.
This commit is contained in:
parent
226484e475
commit
a5024a261a
4 changed files with 133 additions and 79 deletions
|
@ -86,10 +86,9 @@ class FutureReprTests(unittest.IsolatedAsyncioTestCase):
|
|||
async def func():
|
||||
return asyncio.all_tasks()
|
||||
|
||||
# The repr() call should not raise RecursiveError at first.
|
||||
# The check for returned string is not very reliable but
|
||||
# exact comparison for the whole string is even weaker.
|
||||
self.assertIn('...', repr(await asyncio.wait_for(func(), timeout=10)))
|
||||
# The repr() call should not raise RecursionError at first.
|
||||
waiter = await asyncio.wait_for(asyncio.Task(func()),timeout=10)
|
||||
self.assertIn('...', repr(waiter))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue