summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_events.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-128340: add thread safe handle for `loop.call_soon_threadsafe` (#128369)Kumar Aditya2025-01-061-0/+118
| | | Adds `_ThreadSafeHandle` to be used for callbacks scheduled with `loop.call_soon_threadsafe`.
* gh-127949: deprecate `asyncio.set_event_loop` (#128218)Kumar Aditya2024-12-241-9/+17
| | | Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.
* gh-127949: deprecate asyncio policy classes (#128216)Kumar Aditya2024-12-241-11/+23
|
* gh-127949: deprecate `asyncio.get_event_loop_policy` (#128053)Kumar Aditya2024-12-181-11/+18
| | | This deprecates `asyncio.get_event_loop_policy` and will be removed in Python 3.16.
* gh-127949: deprecate `asyncio.set_event_loop_policy` (#128024)Kumar Aditya2024-12-181-9/+13
| | | | First step towards deprecating the asyncio policy system. This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.
* gh-126353: remove implicit creation of loop from `asyncio.get_event_loop` ↵Kumar Aditya2024-11-041-25/+9
| | | | | (#126354) Remove implicit creation of loop from `asyncio.get_event_loop`. This is a step forward of deprecating the policy system of asyncio.
* gh-121025: Improve partialmethod.__repr__ (GH-121033)Bénédikt Tran2024-06-261-1/+1
| | | It no longer contains redundant commas and spaces.
* GH-120804: Remove `PidfdChildWatcher`, `ThreadedChildWatcher` and ↵Kumar Aditya2024-06-231-22/+4
| | | | `AbstractChildWatcher` from asyncio APIs (#120893)
* GH-120804: Remove `get_child_watcher` and `set_child_watcher` from asyncio ↵Kumar Aditya2024-06-231-14/+8
| | | | (#120818)
* GH-120804: Remove SafeChildWatcher, FastChildWatcher and ↵Kumar Aditya2024-06-211-8/+1
| | | | | MultiLoopChildWatcher from asyncio (#120805) Remove SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher from asyncio. These child watchers have been deprecated since Python 3.12. The tests are also removed and some more tests will be added after the rewrite of child watchers.
* gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (#32011)Erik Soma2024-03-231-0/+74
|
* gh-116333: Relax error string text expectations in SSL-related tests (GH-116334)Will Childs-Klein2024-03-211-4/+8
| | | | | | | | | | | | | | | | | | | * Relax error string text expectations in SSL-related tests As suggested [here][1], this change relaxes the OpenSSL error string text expectations in a number of tests. This was specifically done in support of more easily building CPython [AWS-LC][2], but because AWS-LC is a fork of [BoringSSL][3], it should increase compatibility with that library as well. In addition to the error string relaxations, we also add some guards around the `tls-unique` channel binding being used with TLSv1.3, as that feature (described in [RFC 6929][4]) is [not defined][5] for TLSv1.3. [1]: https://discuss.python.org/t/support-building-ssl-and-hashlib-modules-against-aws-lc/44505/4 [2]: https://github.com/aws/aws-lc [3]: https://github.com/google/boringssl [4]: https://datatracker.ietf.org/doc/html/rfc5929#section-3 [5]: https://datatracker.ietf.org/doc/html/rfc8446#appendix-C.5
* gh-112997: Don't log arguments in asyncio unless debugging (#115667)Pierre Ossman (ThinLinc team)2024-02-281-3/+21
| | | | | | Nothing else in Python generally logs the contents of variables, so this can be very unexpected for developers and could leak sensitive information in to terminals and log files.
* gh-114099: Add test exclusions to support running the test suite on iOS ↵Russell Keith-Magee2024-02-051-0/+14
| | | | | | | | | | | | | (#114889) Add test annotations required to run the test suite on iOS (PEP 730). The majority of the change involve annotating tests that use subprocess, but are skipped on Emscripten/WASI for other reasons, and including iOS/tvOS/watchOS under the same umbrella as macOS/darwin checks. `is_apple` and `is_apple_mobile` test helpers have been added to identify *any* Apple platform, and "any Apple platform except macOS", respectively.
* gh-110088: Fix asyncio test_prompt_cancellation() (#110157)Victor Stinner2023-09-301-3/+0
| | | | Don't measure the CI performance: don't test the maximum elapsed time. The check failed on a slow CI.
* gh-110088, gh-109878: Fix test_asyncio timeouts (#110092)Victor Stinner2023-09-291-4/+4
| | | | | | 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.
* gh-109505: Remove unnecessary `hasattr` checks from `test_asyncio` (#109506)Nikita Sobolev2023-09-231-3/+0
|
* gh-109295: Clean up multiprocessing in test_asyncio and test_compileall ↵Victor Stinner2023-09-121-0/+3
| | | | | | | (#109298) test_asyncio and test_compileall now clean up multiprocessing by calling multiprocessing _cleanup_tests(): explicitly clean up resources and stop background processes like the resource tracker.
* gh-109015: Add test.support.socket_helper.tcp_blackhole() (#109016)Victor Stinner2023-09-061-0/+3
| | | | Skip test_asyncio, test_imaplib and test_socket tests if FreeBSD TCP blackhole is enabled (net.inet.tcp.blackhole=2).
* GH-84559: Deprecate fork being the multiprocessing default. (#100618)Gregory P. Smith2023-02-021-1/+8
| | | | | | | | This starts the process. Users who don't specify their own start method and use the default on platforms where it is 'fork' will see a DeprecationWarning upon multiprocessing.Pool() construction or upon multiprocessing.Process.start() or concurrent.futures.ProcessPool use. See the related issue and documentation within this change for details.
* gh-100160: Restore and deprecate implicit creation of an event loop (GH-100410)Serhiy Storchaka2023-01-131-4/+31
| | | | | | | | | | Partially revert changes made in GH-93453. asyncio.DefaultEventLoopPolicy.get_event_loop() now emits a DeprecationWarning and creates and sets a new event loop instead of raising a RuntimeError if there is no current event loop set. Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* GH-86508: skip binding to local addresses of different family in ↵Kumar Aditya2023-01-041-0/+41
| | | | `asyncio.open_connection` (#100615)
* add tests for `asyncio` transport sockets (#100263)Kumar Aditya2022-12-281-0/+23
|
* gh-93453: No longer create an event loop in get_event_loop() (#98440)Serhiy Storchaka2022-12-061-56/+19
| | | | | | | | | | | | | | | 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-94597: Deprecate child watcher getters and setters (#98215)Kumar Aditya2022-10-151-6/+10
| | | | | | | This is the next step for deprecating child watchers. Until we've removed the API completely we have to use it, so this PR is mostly suppressing a lot of warnings when using the API internally. Once the child watcher API is totally removed, the two child watcher implementations we actually use and need (Pidfd and Thread) will be turned into internal helpers.
* GH-94597: deprecate `SafeChildWatcher`, `FastChildWatcher` and ↵Kumar Aditya2022-10-081-3/+7
| | | | `MultiLoopChildWatcher` child watchers (#98089)
* gh-84623: Remove unused imports in tests (#93772)Victor Stinner2022-06-131-1/+0
|
* Simplify testing the warning filename (GH-91868)Serhiy Storchaka2022-04-241-8/+8
| | | The context manager result has the "filename" attribute.
* bpo-46358: modernize `test_asyncio` (GH-30562)Nikita Sobolev2022-01-131-19/+9
|
* bpo-23819: Get rid of assert statements in test_asyncio (GH-30212)Serhiy Storchaka2021-12-201-20/+40
| | | | | | To keep checks even if run tests with optimized Python. Either use special assertion methods like assertEqual() or raise an AssertionError explicitly.
* bpo-23819: asyncio: Replace AssertionError with TypeError where it makes ↵Kumar Aditya2021-12-061-6/+2
| | | | sense (GH-29894)
* bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)Serhiy Storchaka2021-08-211-1/+2
| | | | The code of the test was never executed because the test function was unintentionally converted to a generator function.
* bpo-43216: Remove @asyncio.coroutine (GH-26369)Illia Volochii2021-07-011-2/+2
| | | | | | | | | Remove the @asyncio.coroutine decorator enabling legacy generator-based coroutines to be compatible with async/await code; remove asyncio.coroutines.CoroWrapper used for wrapping legacy coroutine objects in the debug mode. The decorator has been deprecated since Python 3.8 and the removal was initially scheduled for Python 3.10.
* bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() ↵Serhiy Storchaka2021-04-251-10/+67
| | | | | | (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-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145)Inada Naoki2021-04-041-1/+1
| | | | | | | | | | | | | | | | | | | * test_asyncio * test_bz2 * test_math * test_cmath * test_cmd_line * test_cmd_line_script * test_compile * test_contextlib * test_profile * ctypes/test/test_find * test_multiprocessing * test_configparser * test_csv * test_dbm_dumb * test_decimal * test_difflib * os.fdopen() calls io.text_encoding() to emit EncodingWarning for right place.
* bpo-31904: Skip some asyncio tests on VxWorks (#23815)pxinwr2020-12-171-1/+8
|
* bpo-42553: Fix test_asyncio.test_call_later() (GH-23627)Victor Stinner2020-12-031-3/+0
| | | | | Fix test_asyncio.test_call_later() race condition: don't measure asyncio performance in the call_later() unit test. The test failed randomly on the CI.
* bpo-42392: Remove loop parameter form asyncio locks and Queue (#23420)Yurii Karabas2020-11-241-124/+118
| | | Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-38912: fix close before connect callback in test_asyncio SSL tests ↵Justin Turner Arthur2020-10-201-0/+2
| | | | | (GH-22691) Reduces the rate at which the ENV CHANGED failure occurs in test_asyncio SSL tests (due to unclosed transport), but does not 100% resolve it.
* bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)Victor Stinner2020-06-181-2/+2
| | | | | | On Linux, skip tests using multiprocessing if the current user cannot create a file in /dev/shm/ directory. Add the skip_if_broken_multiprocessing_synchronize() function to the test.support module.
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-1/+2
|
* bpo-39148: fixup to account for IPV6_ENABLED being moved (GH-20170)Nathaniel J. Smith2020-05-181-1/+1
|
* bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)Kjell Braden2020-05-181-3/+12
| | | | | | Ifdef is not necessary, as AF_INET6 is supported from Windows Vista, and other code in overlapped.c uses AF_INET6 and is not ifdef'd. Change the raised exception so users are not fooled to think it comes from Windows API. Automerge-Triggered-By: @njsmith
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-251-9/+10
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282)Kyle Stanley2020-04-021-0/+2
| | | Call explicitly self.loop.shutdown_default_executor().
* bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863)Andrew Svetlov2020-01-071-2/+6
| | | https://bugs.python.org/issue39191
* bpo-38614: Use test.support.SHORT_TIMEOUT constant (GH-17566)Victor Stinner2019-12-111-6/+8
| | | | | | | | | | | | | | | Replace hardcoded timeout constants in tests with SHORT_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once. SHORT_TIMEOUT is 30 seconds by default, but it can be longer depending on --timeout command line option. The change makes almost all timeouts longer, except test_reap_children() of test_support which is made 2x shorter: SHORT_TIMEOUT should be enough. If this test starts to fail, LONG_TIMEOUT should be used instead. Uniformize also "from test import support" import in some test files.
* bpo-38614: Use default join_thread() timeout in tests (GH-17559)Victor Stinner2019-12-101-1/+1
| | | | | Tests no longer pass a timeout value to join_thread() of test.support: use the default join_thread() timeout instead (SHORT_TIMEOUT constant of test.support).
* bpo-38614: Use test.support.LOOPBACK_TIMEOUT constant (GH-17554)Victor Stinner2019-12-101-1/+1
| | | | | Replace hardcoded timeout constants in tests with LOOPBACK_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once.
* bpo-38107: Replace direct future and task contructor calls with factories in ↵Andrew Svetlov2019-09-111-15/+15
| | | | asyncio tests (GH-15928)