summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_timeouts.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-111085: Fix invalid state handling in TaskGroup and Timeout ↵Miss Islington (bot)2023-10-211-1/+47
| | | | | | | | | | | | | | | | | | | | (GH-111111) (GH-111171) asyncio.TaskGroup and asyncio.Timeout classes now raise proper RuntimeError if they are improperly used. * When they are used without entering the context manager. * When they are used after finishing. * When the context manager is entered more than once (simultaneously or sequentially). * If there is no current task when entering the context manager. They now remain in a consistent state after an exception is thrown, so subsequent operations can be performed correctly (if they are allowed). (cherry picked from commit 6c23635f2b7067ef091a550954e09f8b7c329e3f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
* [3.12] gh-110088, gh-109878: Fix test_asyncio timeouts (#110092) (#110098)Victor Stinner2023-10-021-20/+0
| | | | | | | | | | gh-110088, gh-109878: Fix test_asyncio timeouts (#110092) Fix test_asyncio timeouts: don't measure the maximum duration, a test should not measure a CI performance. Only measure the minimum duration when a task has a timeout or delay. Add CLOCK_RES to test_asyncio.utils. (cherry picked from commit db0a258e796703e12befea9d6dec04e349ca2f5b)
* gh-102780: Fix uncancel() call in asyncio timeouts (#102815)Kristján Valur Jónsson2023-03-221-0/+30
| | | | | | | Also use `raise TimeOut from <CancelledError instance>` so that the CancelledError is set in the `__cause__` field rather than in the `__context__` field. Co-authored-by: Guido van Rossum <gvanrossum@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-95051: ensure that timeouts scheduled with `asyncio.Timeout` that have ↵Thomas Grainger2022-07-241-0/+24
| | | | | | already expired are deliverered promptly (#95109) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-84623: Remove unused imports in tests (#93772)Victor Stinner2022-06-131-1/+0
|
* bpo-46771: Implement asyncio context managers for handling timeouts (GH-31394)Andrew Svetlov2022-03-101-0/+229
Example: async with asyncio.timeout(5): await some_task() Will interrupt the await and raise TimeoutError if some_task() takes longer than 5 seconds. Co-authored-by: Guido van Rossum <guido@python.org>