summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_tasks.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32676, test_asyncio: Fix warning in test_error_in_call_soon() (GH-7462)Victor Stinner2018-06-061-1/+5
| | | | | | | Fix "<CoroWrapper ...> was never yielded from" warning in PyTask_PyFuture_Tests.test_error_in_call_soon() of test_asyncio.test_tasks. Close manually the coroutine on error.
* bpo-33789, test_asyncio: Hide PendingDeprecationWarning (GH-7461)Victor Stinner2018-06-061-1/+2
| | | Hide PendingDeprecationWarning in test__register_task_3().
* bpo-33562: Check the global asyncio event loop policy isn't set after any ↵Brett Cannon2018-06-021-0/+4
| | | | tests (GH-7328)
* bpo-32684: Fix nits in tests (GH-7225)Yury Selivanov2018-05-291-3/+3
|
* bpo-32751: Wait for task cancellation in asyncio.wait_for() (GH-7216)Elvis Pranskevichus2018-05-291-0/+56
| | | | | | | | | | | | | | | | | | | | | | | Currently, asyncio.wait_for(fut), upon reaching the timeout deadline, cancels the future and returns immediately. This is problematic for when *fut* is a Task, because it will be left running for an arbitrary amount of time. This behavior is iself surprising and may lead to related bugs such as the one described in bpo-33638: condition = asyncio.Condition() async with condition: await asyncio.wait_for(condition.wait(), timeout=0.5) Currently, instead of raising a TimeoutError, the above code will fail with `RuntimeError: cannot wait on un-acquired lock`, because `__aexit__` is reached _before_ `condition.wait()` finishes its cancellation and re-acquires the condition lock. To resolve this, make `wait_for` await for the task cancellation. The tradeoff here is that the `timeout` promise may be broken if the task decides to handle its cancellation in a slow way. This represents a behavior change and should probably not be back-patched to 3.6 and earlier.
* bpo-32684: Fix gather to propagate cancel of itself with return_exceptions ↵Yury Selivanov2018-05-291-1/+28
| | | | (GH-7209)
* bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174)Yury Selivanov2018-05-281-2/+27
|
* bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)Oren Milman2018-02-131-0/+14
|
* bpo-32327: Revert loop.run_in_executor behaviour: return a Future. (#5392)Yury Selivanov2018-01-281-3/+2
| | | | I've run some tests on 3.7 asyncio and it appears that too many things assume that run_in_executor returns a Future.
* bpo-32636: Fix two bugs in test_asyncio (#5302)Victor Stinner2018-01-241-1/+1
|
* bpo-32636: Fix @asyncio.coroutine debug mode bug exposed by gh-5250 (#5291)Nathaniel J. Smith2018-01-241-0/+17
|
* bpo-32643: Drop support for a few private Task and Future APIs. (#5293)Yury Selivanov2018-01-241-25/+3
| | | | | | | | Specifically, it's not possible to subclass Task/Future classes and override the following methods: * Future._schedule_callbacks * Task._step * Task._wakeup
* bpo-32633: Fix some warnings in test_asyncio.test_tasks (#5280)Nathaniel J. Smith2018-01-231-2/+8
|
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-231-10/+99
|
* bpo-31721: Allow Future._log_traceback to only be set to False (#5009)Yury Selivanov2017-12-251-0/+9
|
* bpo-32363: Disable Task.set_exception() and Task.set_result() (#4923)Yury Selivanov2017-12-251-22/+71
|
* bpo-32415: Fix "error is already set" (#4999)Yury Selivanov2017-12-231-0/+26
|
* bpo-32415: Add more tests (#4995)Yury Selivanov2017-12-231-3/+21
|
* bpo-32415: Add asyncio.Task.get_loop() and Future.get_loop() (#4992)Yury Selivanov2017-12-231-5/+8
|
* bpo-32357: Optimize asyncio.iscoroutine() for non-native coroutines (#4915)Yury Selivanov2017-12-191-0/+43
|
* bpo-32348: Optimize asyncio.Future schedule/add/remove callback. (#4907)Yury Selivanov2017-12-181-6/+37
|
* bpo-32250: Implement asyncio.current_task() and asyncio.all_tasks() (#4799)Andrew Svetlov2017-12-161-23/+183
|
* bpo-32311: Implement asyncio.create_task() shortcut (#4848)Andrew Svetlov2017-12-151-0/+37
| | | | | * Implement functionality * Add documentation
* bpo-32327: Convert asyncio functions documented as coroutines to coroutines. ↵Yury Selivanov2017-12-151-7/+14
| | | | (#4872)
* bpo-32101: Fix tests for PYTHONDEVMODE=1 (#4821)Victor Stinner2017-12-121-7/+5
| | | | test_asycio: remove also aio_path which was used when asyncio was developed outside the stdlib.
* bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)Yury Selivanov2017-12-111-12/+3
|
* bpo-32193: Convert asyncio to async/await usage (#4753)Andrew Svetlov2017-12-081-147/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Convert asyncio/tasks.py to async/await * Convert asyncio/queues.py to async/await * Convert asyncio/test_utils.py to async/await * Convert asyncio/base_subprocess.py to async/await * Convert asyncio/subprocess.py to async/await * Convert asyncio/streams.py to async/await * Fix comments * Convert asyncio/locks.py to async/await * Convert asyncio.sleep to async def * Add a comment * Add missing news * Convert stubs from AbstrctEventLoop to async functions * Convert subprocess_shell/subprocess_exec * Convert connect_read_pipe/connect_write_pip to async/await syntax * Convert create_datagram_endpoint * Convert create_unix_server/create_unix_connection * Get rid of old style coroutines in unix_events.py * Convert selector_events.py to async/await * Convert wait_closed and create_connection * Drop redundant line * Convert base_events.py * Code cleanup * Drop redundant comments * Fix indentation * Add explicit tests for compatibility between old and new coroutines * Convert windows event loop to use async/await * Fix double awaiting of async function * Convert asyncio/locks.py * Improve docstring * Convert tests to async/await * Convert more tests * Convert more tests * Convert more tests * Convert tests * Improve test
* bpo-32047: -X dev enables asyncio debug mode (#4418)Victor Stinner2017-11-201-0/+4
| | | | The new -X dev command line option now also enables asyncio debug mode.
* bpo-31970: Reduce performance overhead of asyncio debug mode. (#4314)Antoine Pitrou2017-11-071-1/+1
| | | | * bpo-31970: Reduce performance overhead of asyncio debug mode.
* bpo-30406: Make async and await proper keywords (#1669)Jelle Zijlstra2017-10-061-6/+0
| | | Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
* bpo-31556: asyncio.wait_for can cancel futures faster with timeout <= 0 (#3703)Victor K2017-10-051-0/+70
|
* bpo-31061: fix crash in asyncio speedup module (GH-2966)Alexander Mohr2017-08-021-0/+15
|
* bpo-30508: Don't log exceptions if Task/Future "cancel()" method called (#2050)Yury Selivanov2017-06-111-0/+19
|
* bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097)INADA Naoki2017-05-111-0/+18
| | | | | | | | | | | | when there are no more `await` or `yield (from)` before return in coroutine, cancel was ignored. example: async def coro(): asyncio.Task.current_task().cancel() return 42 ... res = await coro() # should raise CancelledError
* bpo-29271: Fix Task.current_task and Task.all_tasks to accept None. (#406)Yury Selivanov2017-03-031-0/+17
|
* Remove unused imports.Serhiy Storchaka2016-12-161-1/+0
|
* Merge 3.6 (issue #28843)Yury Selivanov2016-12-011-0/+15
|
* Merge 3.5 (issue #28703)Yury Selivanov2016-11-151-0/+2
|\
| * Issue #28703: Fix asyncio.iscoroutinefunction to handle Mock objects.Yury Selivanov2016-11-151-0/+2
| |
* | Merge 3.5 (issue #28613)Yury Selivanov2016-11-041-0/+5
|\ \ | |/
| * Issue #28613: Fix get_event_loop() to return the current loopYury Selivanov2016-11-041-0/+5
| | | | | | | | when called from coroutines or callbacks.
* | Issue #28544: Implement asyncio.Task in C.Yury Selivanov2016-10-281-134/+305
|/ | | | | | | | This implementation provides additional 10-20% speed boost for asyncio programs. The patch also fixes _asynciomodule.c to use Arguments Clinic, and makes '_schedule_callbacks' an overridable method (as it was in 3.5).
* Issue #26923: Fix asyncio.Gather to refuse being cancelled once all children ↵Yury Selivanov2016-10-211-0/+30
| | | | | | are done. Patch by Johannes Ebke.
* Issue #27972: Prohibit Tasks to await on themselves.Yury Selivanov2016-10-091-0/+11
|
* Misc asyncio improvements from upstreamGuido van Rossum2016-09-301-0/+31
|
* asyncio: Remove asyncio.timeout() context manager.Yury Selivanov2016-06-081-187/+0
| | | | | | | It will probably be added back in Python 3.6, once its compatibility issues are resolved; see [1] for more details. [1] https://mail.python.org/pipermail/async-sig/2016-June/000045.html
* Fix test_asyncio.test_timeout_disable()Victor Stinner2016-04-181-1/+3
| | | | | | | | | | | Issue #26777: Fix random failing of the test on the "AMD64 FreeBSD 9.x 3.5" buildbot: File ".../Lib/test/test_asyncio/test_tasks.py", line 2398, in go self.assertTrue(0.09 < dt < 0.11, dt) AssertionError: False is not true : 0.11902812402695417 Replace "< 0.11" with "< 0.15".
* asyncio: allow None as wait timeoutVictor Stinner2016-04-011-0/+16
| | | | | | Fix GH#325: Allow to pass None as a timeout value to disable timeout logic. Change written by Andrew Svetlov and merged by Guido van Rossum.
* asyncio: Fix @coroutine to recognize CoroWrapper (issue #25647)Yury Selivanov2016-03-021-0/+24
| | | | Patch by Vladimir Rutsky.
* test_asyncio: fix test_timeout_time()Victor Stinner2016-02-011-1/+2
| | | | | Accept time delta up to 0.12 second, instead of 0.11, for the "AMD64 FreeBSD 9.x" buildbot slave.