summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)Miss Islington (bot)2019-09-123-89/+117
| | | | | (cherry picked from commit a488879cbaf4b8b52699cadccf73bb4c271bcb29) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-38107: Replace direct future and task contructor calls with factories in ↵Miss Islington (bot)2019-09-1113-159/+156
| | | | | | | asyncio tests (GH-15928) (cherry picked from commit 9aee90018a5213e3529768e0b873955d23f5e50b) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* [3.8] bpo-36373: Fix deprecation warnings (GH-15889) (GH-15901)Andrew Svetlov2019-09-112-6/+4
| | | | | | https://bugs.python.org/issue36373 (cherry picked from commit 7264e92b718d307cc499b2f10eab7644b00f0499) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-38066: Hide internal Stream methods (GH-15762)Miss Islington (bot)2019-09-102-81/+105
| | | | | | | | feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now. https://bugs.python.org/issue38066 (cherry picked from commit 12c122ae958a55c9874ed4c7d7805ceb084411d7) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs ↵Miss Islington (bot)2019-09-105-253/+372
| | | | | | | | | | | | | | [locks] (GH-13920) This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. Third step: locks.py https://bugs.python.org/issue36373 (cherry picked from commit 537877d85d1c27d2c2f5189e39da64a7a0c413d3) Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
* bpo-34679: Restore instantiation Windows IOCP event loop from non-main ↵Miss Islington (bot)2019-08-261-0/+19
| | | | | | | | | | thread (GH-15492) * Restore running proactor event loop from non-main thread Co-Authored-By: Kyle Stanley <aeros167@gmail.com> (cherry picked from commit 1c0600998681295735a18690fae184b0c9a4ca51) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Remove unused imports in tests (GH-14518) (GH-14520)Victor Stinner2019-07-017-12/+0
| | | (cherry picked from commit 8f4ef3b019ce380022018587571b0f970e668de3)
* bpo-37199: Fix test failures when IPv6 is unavailable or disabled (GH-14480)Miss Islington (bot)2019-06-301-1/+8
| | | | | (cherry picked from commit c2cda638d63b98f5cf9a8ef13e15aace2b7e3f0b) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-35621: Support running subprocesses in asyncio when loop is executed in ↵Miss Islington (bot)2019-06-303-26/+61
| | | | | | | non-main thread (GH-14344) (cherry picked from commit 0d671c04c39b52e44597491b893eb0b6c86b3d45) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Replace deprecation warning with RuntimeError (GH-14397)Miss Islington (bot)2019-06-271-0/+6
| | | | | (cherry picked from commit 97d15b1ee06ce80c4dbda91fb538a89bbcb2bed9) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Get rid of exception traceback printing in asyncio tests (GH-14343)Miss Islington (bot)2019-06-241-2/+2
| | | | | (cherry picked from commit 549f7d45c8d61ab7b1d4a4e266b9d790ad6f7504) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-37323: Suppress DeprecationWarning raised by @asyncio.coroutine (GH-14293)Miss Islington (bot)2019-06-221-1/+3
| | | | | | | | When the test is ran with `PYTHONWARNINGS=error` the environment variable is passed to the python interpreter used in `assert_python_ok` where `DeprecationWarning` from `@asyncio.coroutine` is converted into an error. Ignore the `DeprecationWarning` in `assert_python_ok`. https://bugs.python.org/issue37323 (cherry picked from commit 186f70905d07b42a9cbf0a29e448f30baf2b53cb) Co-authored-by: Xtreak <tir.karthi@gmail.com>
* bpo-35031: also disable TLS 1.3 for test_start_tls_server_1 on macOS (GH-14188)Miss Islington (bot)2019-06-181-2/+4
| | | | | (cherry picked from commit a514f782b822bd7bca7c8d78be7bd53bc25c1908) Co-authored-by: Ned Deily <nad@python.org>
* bpo-35031, test_asycio: disable TLS 1.3 in test_start_tls_server_1() (GH-14148)Miss Islington (bot)2019-06-171-0/+6
| | | | | | | | bpo-35031, bpo-35998: Reintroduce workaround on Windows and FreeBSD in test_start_tls_server_1() of test_asyncio: disable TLS v1.3 on the client context. (cherry picked from commit c034b7824f5a7c50f2946ab3931633200e31d903) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37279: Fix asyncio sendfile support when extra data are sent in ↵Miss Islington (bot)2019-06-151-1/+2
| | | | | | | fallback mode. (GH-14075) (cherry picked from commit ef2152354f03a165c5e3adb53e2276934fabd50a) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1() ↵Miss Islington (bot)2019-06-141-18/+19
| | | | | | | (GH-14080) (cherry picked from commit f0749da9a535375f05a2015e8960e8ae54877349) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-37278: Fix test_asyncio ProactorLoopCtrlC (GH-14074)Miss Islington (bot)2019-06-141-7/+8
| | | | | | | | | | | | | | | | Join the thread to prevent leaking a running thread and leaking a reference. Cleanup also the test: * asyncioWindowsProactorEventLoopPolicy became the default policy, there is no need to set it manually. * Only start the thread once the loop is running. * Use a shorter sleep in the thread (100 ms rather than 1 sec). * Use close_loop(loop) rather than loop.close(). * Use longer variable names. (cherry picked from commit 07559450b2d9179e4c99e0af088ce7550e549f94) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* Make asyncio stream sendfile fail on error (was hang) (GH-14025)Miss Islington (bot)2019-06-121-5/+8
| | | | | (cherry picked from commit 0d1942774a70d561dbaaa980742dd0927e8aa51a) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-35545: Skip `test_asyncio.test_create_connection_ipv6_scope` on AIX ↵Miss Islington (bot)2019-06-121-0/+2
| | | | | | | | | | (GH-14011) because "getaddrinfo()" behaves different on AIX https://bugs.python.org/issue35545 (cherry picked from commit 32dda263e4e8c8e0fadc2bb29b9856e2f177dde9) Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
* 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)
* Revert "bpo-35621: Support running subprocesses in asyncio when loop is ↵Andrew Svetlov2019-06-032-48/+26
| | | | | executed in non-main thread (#13630)" (GH-13793) https://bugs.python.org/issue35621
* bpo-37137: Fix test_asyncio: use TestCase.set_event_loop() (GH-13779)Victor Stinner2019-06-031-13/+8
| | | | | | | | | Replace asyncio.set_event_loop() with TestCase.set_event_loop() of test_asyncio.utils: this method calls TestCase.close_loop() which waits until the executor completes, to avoid leaking dangling threads. Inherit from test_asyncio.utils.TestCase rather than unittest.TestCase.
* bpo-35621: Fix tests when SafeChildWatcher is expected instead of ↵Andrew Svetlov2019-06-021-0/+1
| | | | | ThreadedChildWatcher (GH-13754) https://bugs.python.org/issue35621
* bpo-35621: Support running subprocesses in asyncio when loop is executed in ↵Andrew Svetlov2019-06-022-26/+48
| | | | non-main thread (#13630)
* bpo-36999: Add asyncio.Task.get_coro() (GH-13680)Alex Grönholm2019-05-301-0/+10
| | | https://bugs.python.org/issue36999
* bpo-37015: Ensure tasks created by _accept_connection2 due to AsyncMock are ↵Xtreak2019-05-301-6/+8
| | | | | | | | completed (GH-13661) From 3.8 async functions used with mock.patch return an `AsyncMock`. `_accept_connection2` is an async function where create_task is also mocked. Don't mock `create_task` so that tasks are created out of coroutine returned by `AsyncMock` and the tasks are completed. https://bugs.python.org/issue37015
* bpo-35246: fix support for path-like args in asyncio subprocess (GH-13628)依云2019-05-281-0/+11
| | | | | | | | | Drop isinstance checks from create_subprocess_exec function and let subprocess module do them. https://bugs.python.org/issue35246 https://bugs.python.org/issue35246
* bpo-29883: Asyncio proactor udp (GH-13440)Andrew Svetlov2019-05-282-9/+278
| | | | | | Follow-up for #1067 https://bugs.python.org/issue29883
* bpo-36686: Improve the documentation of the std* params in ↵sbstp2019-05-271-0/+90
| | | | | loop.subprocess_exec (GH-13586) https://bugs.python.org/issue36686
* bpo-36889: Merge asyncio streams (GH-13251)Andrew Svetlov2019-05-277-213/+872
| | | https://bugs.python.org/issue36889
* bpo-37027: Return a proxy socket object from transp.get_extra_info('socket') ↵Yury Selivanov2019-05-272-3/+3
| | | | | | | | | | (GH-13530) Return a safe to use proxy socket object from `transport.get_extra_info('socket')` https://bugs.python.org/issue37027
* bpo-37035: Don't log OSError (GH-13548)Andrew Svetlov2019-05-272-7/+26
| | | https://bugs.python.org/issue37035
* bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)Yury Selivanov2019-05-272-6/+4
| | | | | | | | | | | | | | | This will address the common mistake many asyncio users make: an "except Exception" clause breaking Tasks cancellation. In addition to this change, we stop inheriting asyncio.TimeoutError and asyncio.InvalidStateError from their concurrent.futures.* counterparts. There's no point for these exceptions to share the inheritance chain. In 3.9 we'll focus on implementing supervisors and cancel scopes, which should allow better handling of all exceptions, including SystemExit and KeyboardInterrupt
* Pass _asyncio_internal=True into stream tests on windows (#13442)Andrew Svetlov2019-05-201-2/+4
|
* bpo-35721: Close socket pair if Popen in _UnixSubprocessTransport fails ↵Niklas Fiekas2019-05-201-4/+13
| | | | | | | | (GH-11553) This slightly expands an existing test case `test_popen_error` to trigger a `ResourceWarning` and fixes it. https://bugs.python.org/issue35721
* bpo-35545: Fix asyncio discarding IPv6 scopes (GH-11271)Erwan Le Pape2019-05-171-0/+22
| | | | | | | | This PR proposes a solution to [bpo-35545](https://bugs.python.org/issue35545) by adding an optional `flowinfo` and `scopeid` to `asyncio.base_events._ipaddr_info` to carry the full address information into `_ipaddr_info` and avoid discarding IPv6 specific information. Changelog entry & regression tests to come. https://bugs.python.org/issue35545
* bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)Andrew Svetlov2019-05-166-310/+290
| | | | | | The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is. https://bugs.python.org/issue36921
* bpo-35926: Add support for OpenSSL 1.1.1b on Windows (GH-11779)Paul Monson2019-05-151-2/+2
|
* bpo-36801: Temporarily fix regression in writer.drain() (#13330)Andrew Svetlov2019-05-151-23/+0
|
* bpo-36916: asyncio: Swallow unhandled write() exception (GH-13313)Andrew Svetlov2019-05-141-0/+3
|
* bpo-36884: Fix DeprecationWarning in test_asyncio StreamReader instantiation ↵Xtreak2019-05-111-1/+1
| | | | | (GH-13243) https://bugs.python.org/issue36884
* 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
* bpo-35125: remove inner callback on outer cancellation in asyncio shield ↵Romain Picard2019-05-071-1/+10
| | | | | | | | | | | | | | (GH-10340) When the future returned by shield is cancelled, its completion callback of the inner future is not removed. This makes the callback list of inner inner future grow each time a shield is created and cancelled. This change unregisters the callback from the inner future when the outer future is cancelled. https://bugs.python.org/issue35125
* bpo-31922: Do not connect UDP sockets when broadcast is allowed (GH-423)Vincent Michel2019-05-072-0/+18
| | | | | | | | | | | | *Moved from python/asyncio#493.* This PR fixes issue python/asyncio#480, as explained in [this comment](https://github.com/python/asyncio/issues/480#issuecomment-278703828). The `_SelectorDatagramTransport.sendto` method has to be modified ~~so `_sock.sendto` is used in all cases (because it is tricky to reliably tell if the socket is connected or not). Could that be an issue for connected sockets?~~ *EDIT* ... so `_sock.send` is used only if `_sock` is connected. It also protects `socket.getsockname` against `OSError` in `_SelectorTransport`. This might happen on Windows if the socket is not connected (e.g. for UDP broadcasting). https://bugs.python.org/issue31922
* Forbid creating of stream objects outside of asyncio (#13101)Andrew Svetlov2019-05-062-50/+128
|
* bpo-24638: Improve the error message in asyncio.ensure_future() (#12848)Zackery Spytz2019-05-031-0/+9
|
* bpo-36341: Fix tests calling bind() on AF_UNIX sockets (GH-12399)xdegaye2019-05-031-1/+1
| | | | | | | Those tests may fail with PermissionError. https://bugs.python.org/issue36341