summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_streams.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-127949: deprecate `asyncio.set_event_loop` (#128218)Kumar Aditya2024-12-241-5/+5
| | | Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.
* gh-127949: deprecate `asyncio.set_event_loop_policy` (#128024)Kumar Aditya2024-12-181-1/+1
| | | | First step towards deprecating the asyncio policy system. This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.
* GH-119866: Spill the stack around escaping calls. (GH-124392)Mark Shannon2024-10-071-3/+3
| | | | | | | * Spill the evaluation around escaping calls in the generated interpreter and JIT. * The code generator tracks live, cached values so they can be saved to memory when needed. * Spills the stack pointer around escaping calls, so that the exact stack is visible to the cycle GC.
* gh-124858: fix happy eyeballs refcyles (#124859)Thomas Grainger2024-10-021-0/+18
|
* GH-120804: Remove SafeChildWatcher, FastChildWatcher and ↵Kumar Aditya2024-06-211-46/+0
| | | | | 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-117722: Fix Stream.readuntil with non-bytes buffer objects (#117723)Bruce Merry2024-04-111-7/+14
| | | | | | | | | | | | | gh-16429 introduced support for an iterable of separators in Stream.readuntil. Since bytes-like types are themselves iterable, this can introduce ambiguities in deciding whether the argument is an iterator of separators or a singleton separator. In gh-16429, only 'bytes' was considered a singleton, but this will break code that passes other buffer object types. Fix it by only supporting tuples rather than arbitrary iterables. Closes gh-117722.
* gh-81322: support multiple separators in StreamReader.readuntil (#16429)Bruce Merry2024-04-081-0/+46
|
* gh-116112: Fix `ResourceWarning` in `test_asyncio.test_stream` (#116371)Nikita Sobolev2024-03-051-0/+1
| | | Co-authored-by: @CendioOssman
* gh-114914: Avoid keeping dead StreamWriter alive (#115661)Pierre Ossman (ThinLinc team)2024-02-281-0/+25
| | | | | | | | | | In some cases we might cause a StreamWriter to stay alive even when the application has dropped all references to it. This prevents us from doing automatical cleanup, and complaining that the StreamWriter wasn't properly closed. Fortunately, the extra reference was never actually used for anything so we can just drop it.
* gh-114099: Add test exclusions to support running the test suite on iOS ↵Russell Keith-Magee2024-02-051-1/+2
| | | | | | | | | | | | | (#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-113538: Don't error in stream reader protocol callback when task is ↵Guido van Rossum2024-01-041-7/+13
| | | | cancelled (#113690)
* gh-112186: Improve test case `test_loop_is_closed_resource_warnings` (#112187)DPR2023-11-191-6/+3
|
* gh-109538: Avoid RuntimeError when StreamWriter is deleted with closed loop ↵DPR2023-11-151-2/+39
| | | | | | | (#111983) Issue a ResourceWarning instead. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-111644: Fix asyncio test_unhandled_exceptions() (#111713)Victor Stinner2023-11-041-2/+3
| | | | | | | | | Fix test_unhandled_exceptions() of test_asyncio.test_streams: break explicitly a reference cycle. Fix also StreamTests.tearDown(): the loop must not be closed explicitly, but using set_event_loop() which takes care of shutting down the executor with executor.shutdown(wait=True). BaseEventLoop.close() calls executor.shutdown(wait=False).
* GH-110894: Call loop exception handler for exceptions in client_connected_cb ↵Kumar Aditya2023-11-021-0/+28
| | | | | (#111601) Call loop exception handler for exceptions in `client_connected_cb` of `asyncio.start_server` so that applications can handle it.
* GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed ↵Kumar Aditya2023-08-051-0/+23
| | | | (#107650)
* 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-94597: Deprecate child watcher getters and setters (#98215)Kumar Aditya2022-10-151-2/+6
| | | | | | | 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-2/+4
| | | | `MultiLoopChildWatcher` child watchers (#98089)
* gh-97983: Revert "Lay the foundation for further work in ↵Oleg Iarygin2022-10-071-129/+197
| | | | | | | | | | | | | | | | | | | | asyncio.test_streams: port server cases to IsolatedAsyncioTestCase" (#98015) This PR reverts gh-93369 and gh-97896 because they've made asyncio tests unstable. After these PRs were merged, random GitHub action jobs of random commits started to fail unrelated tests and test framework methods. The reverting is necessary because such shrapnel failures are a symptom of some underlying bug that must be found and fixed first. I had a hope that it's a server overload because we already have extremely rare disc access errors. However, one and a half day passed, and the failures continue to emerge both in PRs and commits. Affected issue: gh-93357. First reported in https://github.com/python/cpython/pull/97940#issuecomment-1270004134. * Revert "gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 (#97896)" This reverts commit 09aea94d291fed2f3e96558dcd6db04014c3e2fb. * Revert "gh-93357: Start porting asyncio server test cases to IsolatedAsyncioTestCase (#93369)" This reverts commit ce8fc186ac81bce1727bf4192205148daabf5c2e.
* gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 (#97896)Oleg Iarygin2022-10-051-29/+15
| | | This fixes the buildbots.
* gh-93357: Start porting asyncio server test cases to IsolatedAsyncioTestCase ↵Oleg Iarygin2022-10-041-173/+119
| | | | | (#93369) Lay the foundation for further work in `asyncio.test_streams`.
* GH-74116: Allow multiple drain waiters for asyncio.StreamWriter (GH-94705)Kumar Aditya2022-08-291-0/+19
|
* Simplify testing the warning filename (GH-91868)Serhiy Storchaka2022-04-241-4/+4
| | | The context manager result has the "filename" attribute.
* gh-79156: Add start_tls() method to streams API (#91453)Oleg Iarygin2022-04-151-0/+63
| | | | | | | | | | | | | The existing event loop `start_tls()` method is not sufficient for connections using the streams API. The existing StreamReader works because the new transport passes received data to the original protocol. The StreamWriter must then write data to the new transport, and the StreamReaderProtocol must be updated to close the new transport correctly. The new StreamWriter `start_tls()` updates itself and the reader protocol to the new SSL transport. Co-authored-by: Ian Good <icgood@gmail.com>
* bpo-23819: Get rid of assert statements in test_asyncio (GH-30212)Serhiy Storchaka2021-12-201-2/+2
| | | | | | To keep checks even if run tests with optimized Python. Either use special assertion methods like assertEqual() or raise an AssertionError explicitly.
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-1/+1
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() ↵Serhiy Storchaka2021-04-251-11/+42
| | | | | | (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-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361)Christian Heimes2021-04-121-1/+1
|
* bpo-34215: Clarify IncompleteReadError message when "expected" is None ↵Zackery Spytz2020-11-281-3/+5
| | | | | (GH-21925) Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
* bpo-42392: Remove loop parameter from asyncio.streams (GH-23517)Yurii Karabas2020-11-261-52/+26
|
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-251-5/+5
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-38529: Fix asyncio stream warning (GH-17474)Andrew Svetlov2019-12-071-53/+0
|
* bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)Yury Selivanov2019-09-301-950/+182
| | | See https://bugs.python.org/issue38242 for more details
* bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)Andrew Svetlov2019-09-121-3/+4
|
* bpo-38107: Replace direct future and task contructor calls with factories in ↵Andrew Svetlov2019-09-111-18/+16
| | | | asyncio tests (GH-15928)
* bpo-38066: Hide internal Stream methods (GH-15762)Andrew Svetlov2019-09-101-79/+103
| | | | | | feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now. https://bugs.python.org/issue38066
* Replace deprecation warning with RuntimeError (GH-14397)Andrew Svetlov2019-06-271-0/+6
|
* Make asyncio stream sendfile fail on error (was hang) (GH-14025)Andrew Svetlov2019-06-121-5/+8
|
* bpo-37142: Make asyncio stream tests more robust again (GH-13804)Andrew Svetlov2019-06-041-9/+16
| | | | Make test_stream_server_close() implementation following test_stream_server_abort(). Add explicit timeout for tests that can hang.
* Make StreamServer.close() tests more robust (GH-13790)Andrew Svetlov2019-06-041-11/+37
|
* bpo-37148: Fix asyncio test that check for warning when running the test ↵Pablo Galindo2019-06-041-0/+4
| | | | suite with huntleaks (GH-13800)
* bpo-36889: Merge asyncio streams (GH-13251)Andrew Svetlov2019-05-271-180/+828
| | | https://bugs.python.org/issue36889
* bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)Andrew Svetlov2019-05-161-2/+1
| | | | | | The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is. https://bugs.python.org/issue36921
* bpo-36801: Temporarily fix regression in writer.drain() (#13330)Andrew Svetlov2019-05-141-23/+0
|
* bpo-36916: asyncio: Swallow unhandled write() exception (GH-13313)Andrew Svetlov2019-05-141-0/+3
|
* bpo-36802: Drop awrite()/aclose(), support await write() and await close() ↵Andrew Svetlov2019-05-091-12/+30
| | | | instead (#13099)
* bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport ↵Andrew Svetlov2019-05-071-0/+23
| | | | | (GH-13098) https://bugs.python.org/issue36801
* Forbid creating of stream objects outside of asyncio (#13101)Andrew Svetlov2019-05-071-50/+116
|
* bpo-35934: Add socket.create_server() utility function (GH-11784)Giampaolo Rodola2019-04-081-8/+3
|