summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio/test_futures.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-101326: Fix regression when passing None to FutureIter.throw (#101327)Shantanu2023-01-251-0/+2
|
* gh-93453: No longer create an event loop in get_event_loop() (#98440)Serhiy Storchaka2022-12-061-16/+8
| | | | | | | | | | | | | | | asyncio.get_event_loop() now always return either running event loop or the result of get_event_loop_policy().get_event_loop() call. The latter should now raise an RuntimeError if no current event loop was set instead of creating and setting a new event loop. It affects also a number of asyncio functions and constructors which call get_event_loop() implicitly: ensure_future(), shield(), gather(), etc. DeprecationWarning is no longer emitted if there is no running event loop but the current event loop was set. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* GH-90985: Revert "Deprecate passing a message into cancel()" (#97999)Guido van Rossum2022-10-061-10/+2
| | | | | Reason: we were too hasty in deprecating this. We shouldn't deprecate it before we have a replacement.
* GH-97592: Fix crash in C remove_done_callback due to evil code (#97660)Guido van Rossum2022-09-301-0/+15
| | | | Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.
* gh-96348: Deprecate the 3-arg signature of coroutine.throw and ↵Ofey Chan2022-09-301-4/+9
| | | | generator.throw (GH-96428)
* Simplify testing the warning filename (GH-91868)Serhiy Storchaka2022-04-241-4/+4
| | | The context manager result has the "filename" attribute.
* bpo-46829: Deprecate passing a message into Future.cancel() and ↵Andrew Svetlov2022-03-231-2/+10
| | | | | Task.cancel() (GH-31840) After a long deliberation we ended up feeling that the message argument for Future.cancel(), added in 3.9, was a bad idea, so we're deprecating it in 3.11 and plan to remove it in 3.13.
* bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777)Kumar Aditya2022-01-221-1/+6
| | | | | | | | | | | | * bpo-46469: Make asyncio generic classes return GenericAlias * 📜🤖 Added by blurb_it. * Update Misc/NEWS.d/next/Library/2022-01-22-05-05-08.bpo-46469.plUab5.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* bpo-46358: modernize `test_asyncio` (GH-30562)Nikita Sobolev2022-01-131-7/+4
|
* bpo-23819: Get rid of assert statements in test_asyncio (GH-30212)Serhiy Storchaka2021-12-201-9/+9
| | | | | | To keep checks even if run tests with optimized Python. Either use special assertion methods like assertEqual() or raise an AssertionError explicitly.
* bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)Serhiy Storchaka2021-08-261-0/+2
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() ↵Serhiy Storchaka2021-04-251-10/+52
| | | | | | (GH-23554) asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop. In future releases it will became an alias of asyncio.get_running_loop().
* bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)Chris Jerdonek2020-05-151-0/+21
|
* bpo-38785: Prevent asyncio from crashing (GH-17144)Andrew Svetlov2019-11-131-0/+39
| | | | | | | if parent `__init__` is not called from a constructor of object derived from `asyncio.Future` https://bugs.python.org/issue38785
* bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. ↵Zackery Spytz2018-12-171-0/+7
| | | | (GH-11175)
* bpo-33562: Check the global asyncio event loop policy isn't set after any ↵Brett Cannon2018-06-011-0/+4
| | | | tests (GH-7328)
* bpo-32643: Drop support for a few private Task and Future APIs. (#5293)Yury Selivanov2018-01-241-4/+0
| | | | | | | | Specifically, it's not possible to subclass Task/Future classes and override the following methods: * Future._schedule_callbacks * Task._step * Task._wakeup
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-221-4/+10
|
* bpo-31721: Allow Future._log_traceback to only be set to False (#5009)Yury Selivanov2017-12-251-0/+5
|
* bpo-32363: Disable Task.set_exception() and Task.set_result() (#4923)Yury Selivanov2017-12-251-1/+2
|
* bpo-32415: Add asyncio.Task.get_loop() and Future.get_loop() (#4992)Yury Selivanov2017-12-231-0/+1
|
* bpo-32348: Optimize asyncio.Future schedule/add/remove callback. (#4907)Yury Selivanov2017-12-171-21/+138
|
* bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)Yury Selivanov2017-12-111-5/+2
|
* bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076)Serhiy Storchaka2017-09-031-8/+37
|
* bpo-31250, test_asyncio: fix dangling threads (#3252)Victor Stinner2017-09-011-0/+2
| | | | | | | * Explicitly call shutdown(wait=True) on executors to wait until all threads complete to prevent side effects between tests. * Fix test_loop_self_reading_exception(): don't mock loop.close(). Previously, the original close() method was called rather than the mock, because how set_event_loop() registered loop.close().
* bpo-31061: fix crash in asyncio speedup module (GH-2966)Alexander Mohr2017-08-021-0/+12
|
* bpo-30828: Fix out of bounds write in ↵Yury Selivanov2017-07-051-1/+23
| | | | `asyncio.CFuture.remove_done_callback() (#2569)
* bpo-30508: Don't log exceptions if Task/Future "cancel()" method called (#2050)Yury Selivanov2017-06-111-0/+8
|
* bpo-28963: Fix out of bound iteration in ↵Yury Selivanov2017-03-021-0/+29
| | | | asyncio.Future.remove_done_callback/C (#408)
* correctly emulate error semantics of gen.throw in FutureIter_throwBenjamin Peterson2016-11-141-0/+9
|
* Merge 3.5 (issue #28634)Yury Selivanov2016-11-071-0/+23
|\
| * Issue #28634: Fix asyncio.isfuture() to support mocksYury Selivanov2016-11-071-0/+23
| |
* | Merge 3.5 (issue #28613)Yury Selivanov2016-11-041-0/+3
|\ \ | |/
| * Issue #28613: Fix get_event_loop() to return the current loopYury Selivanov2016-11-041-0/+3
| | | | | | | | when called from coroutines or callbacks.
* | asyncio: Increase asyncio.Future test coverage; test both implementations.Yury Selivanov2016-10-231-81/+75
| | | | | | | | | | Also, add 'isfuture' to 'asyncio.futures.__all__', so that it's exposed as 'asyncio.isfuture'.
* | Issue #28492: Fix how StopIteration is raised in _asyncio.FutureYury Selivanov2016-10-201-0/+13
|/
* Merge asyncio upstream.Guido van Rossum2016-09-091-0/+68
|
* Issue #27041: asyncio: Add loop.create_future methodYury Selivanov2016-05-161-8/+9
|
* asyncio/tests: Ensure a gc_collect for __del__ testingYury Selivanov2016-05-131-0/+1
| | | | Patch by Philip Jenvey
* asyncio: Prevent StopIteration from being thrown into a FutureYury Selivanov2016-03-021-0/+4
| | | | Patch by Chris Angelico (issue #26221)
* asyncio: Cleanup Future APIYury Selivanov2015-11-171-4/+7
| | | | See https://github.com/python/asyncio/pull/292 for details.
* Issue #25304: Add asyncio.run_coroutine_threadsafe(). By Vincent Michel.Guido van Rossum2015-10-031-2/+0
|
* asyncio: sync with TulipVictor Stinner2015-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * PipeHandle now uses None instead of -1 for a closed handle * Sort imports in windows_utils. * Fix test_events on Python older than 3.5. Skip SSL tests on the ProactorEventLoop if ssl.MemoryIO is missing * Fix BaseEventLoop._create_connection_transport(). Close the transport if the creation of the transport (if the waiter) gets an exception. * _ProactorBasePipeTransport now sets _sock to None when the transport is closed. * Fix BaseSubprocessTransport.close(). Ignore pipes for which the protocol is not set yet (still equal to None). * TestLoop.close() now calls the close() method of the parent class (BaseEventLoop). * Cleanup BaseSelectorEventLoop: create the protocol on a separated line for readability and ease debugging. * Fix BaseSubprocessTransport._kill_wait(). Set the _returncode attribute, so close() doesn't try to terminate the process. * Tests: explicitly close event loops and transports * UNIX pipe transports: add closed/closing in repr(). Add "closed" or "closing" state in the __repr__() method of _UnixReadPipeTransport and _UnixWritePipeTransport classes.
* asyncio: Truncate to 80 columnsVictor Stinner2015-01-091-8/+16
|
* asyncio: sync with TulipVictor Stinner2014-12-261-1/+1
| | | | | * Fix pyflakes warnings: remove unused imports and variables * asyncio.test_support now uses test.support and test.script_helper if available
* asyncio: sync with TulipVictor Stinner2014-12-181-1/+4
|
* asyncio: Fix formatting of the "Future exception was never retrieved" inVictor Stinner2014-11-201-23/+42
| | | | release mode
* asyncio: sync with TulipVictor Stinner2014-07-291-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | * _WaitHandleFuture.cancel() now notify IocpProactor through the overlapped object that the wait was cancelled. * Optimize IocpProactor.wait_for_handle() gets the result if the wait is signaled immediatly. * Enhance representation of Future and Future subclasses - Add "created at filename:lineno" in the representation - Add Future._repr_info() method which can be more easily overriden than Future.__repr__(). It should now be more easy to enhance Future representation without having to modify each subclass. For example, _OverlappedFuture and _WaitHandleFuture get the new "created at" information. - Use reprlib to format Future result, and function arguments when formatting a callback, to limit the length of the representation. * Fix repr(_WaitHandleFuture) * _WaitHandleFuture and _OverlappedFuture: hide frames of internal calls in the source traceback. * Cleanup ProactorIocp._poll(): set the timeout to 0 after the first call to GetQueuedCompletionStatus() * test_locks: close the temporary event loop and check the condition lock * Remove workaround in test_futures, no more needed
* asyncio: sync with TulipVictor Stinner2014-07-101-0/+6
| | | | | | | | - Issues #21936, #21163: Fix sporadic failures of test_future_exception_never_retrieved() - Handle.cancel() now clears references to callback and args - In debug mode, repr(Handle) now contains the location where the Handle was created.
* asyncio: sync with TulipVictor Stinner2014-07-081-2/+2
| | | | | | | | | | | - Tulip issue 185: Add a create_task() method to event loops. The create_task() method can be overriden in custom event loop to implement their own task class. For example, greenio and Pulsar projects use their own task class. The create_task() method is now preferred over creating directly task using the Task class. - tests: fix a warning - fix typo in the name of a test function - Update AbstractEventLoop: add new event loop methods; update also the unit test