summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_subprocess.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35621: Support running subprocesses in asyncio when loop is executed in ↵Andrew Svetlov2019-06-301-1/+39
| | | | non-main thread (GH-14344)
* Get rid of exception traceback printing in asyncio tests (GH-14343)Andrew Svetlov2019-06-241-2/+2
|
* Revert "bpo-35621: Support running subprocesses in asyncio when loop is ↵Andrew Svetlov2019-06-041-39/+1
| | | | | executed in non-main thread (#13630)" (GH-13793) https://bugs.python.org/issue35621
* bpo-35621: Support running subprocesses in asyncio when loop is executed in ↵Andrew Svetlov2019-06-021-1/+39
| | | | non-main thread (#13630)
* bpo-35246: fix support for path-like args in asyncio subprocess (GH-13628)依云2019-05-291-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-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-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
* Forbid creating of stream objects outside of asyncio (#13101)Andrew Svetlov2019-05-071-0/+12
|
* bpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661)Yury Selivanov2018-10-021-4/+4
|
* bpo-33562: Check the global asyncio event loop policy isn't set after any ↵Brett Cannon2018-06-021-0/+5
| | | | tests (GH-7328)
* Revert "A better fix for asyncio test_stdin_broken_pipe (GH-7221)" (GH-7235)Yury Selivanov2018-05-301-4/+2
| | | | | This reverts commit ad74d50517c069359578014bb32e660828d68332. Turns out it's not a good fix -- Travis has just crashed on this test.
* A better fix for asyncio test_stdin_broken_pipe (#7221)Yury Selivanov2018-05-301-2/+4
|
* Attempt to fix test_stdin_broken_pipe on Travis (#7210)Yury Selivanov2018-05-291-0/+1
|
* bpo-32262: Fix typo in f-string (GH-7016)Christian Heimes2018-05-201-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix typo from commit 6370f345e1d5829e1fba59cd695c8b82c5a8c620 Signed-off-by: Christian Heimes <christian@python.org> <!-- Thanks for your contribution! Please read this comment in its entirety. It's quite important. # Pull Request title It should be in the following format: ``` bpo-NNNN: Summary of the changes made ``` Where: bpo-NNNN refers to the issue number in the https://bugs.python.org. Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue. # Backport Pull Request title If this is a backport PR (PR made against branches other than `master`), please ensure that the PR title is in the following format: ``` [X.Y] <title from the original PR> (GH-NNNN) ``` Where: [X.Y] is the branch name, e.g. [3.6]. GH-NNNN refers to the PR number from `master`. --> <!-- issue-number: bpo-32262 --> https://bugs.python.org/issue32262 <!-- /issue-number -->
* bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)Yury Selivanov2017-12-111-5/+3
|
* bpo-32193: Convert asyncio to async/await usage (#4753)Andrew Svetlov2017-12-081-59/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-31034: Reliable signal handler for test_asyncio (#2867)Victor Stinner2017-07-251-18/+25
| | | | | | | | | * bpo-31034: Reliable signal handler for test_asyncio Don't rely on the current SIGHUP signal handler, make sure that it's set to the "default" signal handler: SIG_DFL. * Add comments
* asyncio: Fix trailing whitespace/code styleYury Selivanov2017-03-031-4/+6
|
* bpo-29704: Fix asyncio.SubprocessStreamProtocol closing (#405)Seth M. Larson2017-03-031-0/+22
|
* Issue #28613: Fix get_event_loop() to return the current loopYury Selivanov2016-11-041-0/+3
| | | | when called from coroutines or callbacks.
* Issue #28368: Refuse monitoring processes if the child watcher has no loop ↵Yury Selivanov2016-10-051-0/+7
| | | | | | attached. Patch by Vincent Michel.
* Issue #27076: Doc, comment and tests spelling fixesMartin Panter2016-05-261-1/+1
| | | | Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
* Issue #26848: Fix asyncio/subprocess.communicate() to handle empty input.Yury Selivanov2016-05-131-0/+19
|
* asyncio, selectors: Update to the upstream versionYury Selivanov2016-03-021-1/+2
|
* Issue #26325: Added test.support.check_no_resource_warning() to check thatSerhiy Storchaka2016-02-111-2/+1
| | | | no ResourceWarning is emitted.
* asyncio: Add Transport.is_closing()Yury Selivanov2015-11-161-1/+1
| | | | See https://github.com/python/asyncio/pull/291 for details.
* Issue #24763: Fix asyncio test on Windows (fix reverted change)Yury Selivanov2015-08-091-1/+5
| | | | See also issue #24835
* asyncio: Sync with upstream (compat module)Yury Selivanov2015-08-041-5/+1
|
* Issue #24763: Fix asyncio test on WindowsVictor Stinner2015-07-311-1/+5
|
* Fix ResourceWarning in asyncio.BaseSubprocessTransportVictor Stinner2015-07-311-0/+15
| | | | | | | Issue #24763: Fix resource warnings when asyncio.BaseSubprocessTransport constructor fails, if subprocess.Popen raises an exception for example. Patch written by Martin Richard, test written by me.
* asyncio: sync with github asyncioVictor Stinner2015-07-091-1/+1
| | | | | * queues: get coroutine from asyncio.coroutines, not from asyncio.tasks * tets: replace tulip with asyncio in comments
* asyncio: Fix warning in test_close_kill_running()Victor Stinner2015-02-171-0/+1
| | | | | Read process exit status to avoid the "Caught subprocess termination from unknown pid" message.
* Issue #23475, asyncio: Fix test_close_kill_running()Victor Stinner2015-02-171-2/+10
| | | | | | Really kill the child process, don't mock completly the Popen.kill() method. This change fix memory leaks and reference leaks.
* asyncio: BaseSubprocessTransport.close() doesn't try to kill the process if itVictor Stinner2015-02-101-0/+55
| | | | already finished
* Issue #23347, asyncio: send_signal(), terminate(), kill() don't check if theVictor Stinner2015-01-301-16/+0
| | | | | | | transport was closed. The check broken a Tulip example and this limitation is arbitrary. Check if _proc is None should be enough. Enhance also close(): do nothing when called the second time.
* asyncio: Fix ResourceWarning in test_subprocess.test_proc_exit()Victor Stinner2015-01-291-0/+2
|
* asyncio: sync with TulipVictor Stinner2015-01-291-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #23347: send_signal(), kill() and terminate() methods of BaseSubprocessTransport now check if the transport was closed and if the process exited. Issue #23347: Refactor creation of subprocess transports. Changes on BaseSubprocessTransport: * Add a wait() method to wait until the child process exit * The constructor now accepts an optional waiter parameter. The _post_init() coroutine must not be called explicitly anymore. It makes subprocess transports closer to other transports, and it gives more freedom if we want later to change completly how subprocess transports are created. * close() now kills the process instead of kindly terminate it: the child process may ignore SIGTERM and continue to run. Call explicitly terminate() and wait() if you want to kindly terminate the child process. * close() now logs a warning in debug mode if the process is still running and needs to be killed * _make_subprocess_transport() is now fully asynchronous again: if the creation of the transport failed, wait asynchronously for the process eixt. Before the wait was synchronous. This change requires close() to *kill*, and not terminate, the child process. * Remove the _kill_wait() method, replaced with a more agressive close() method. It fixes _make_subprocess_transport() on error. BaseSubprocessTransport.close() calls the close() method of pipe transports, whereas _kill_wait() closed directly pipes of the subprocess.Popen object without unregistering file descriptors from the selector (which caused severe bugs). These changes simplifies the code of subprocess.py.
* Issue #22685: Fix test_pause_reading() of asyncio/test_subprocessVictor Stinner2015-01-151-2/+12
| | | | | | | Override the connect_read_pipe() method of the loop to mock immediatly pause_reading() and resume_reading() methods. The test failed randomly on FreeBSD 9 buildbot and on Windows using trollius.
* asyncio: Close transports in testsVictor Stinner2015-01-151-0/+1
| | | | | | | | | * Use test_utils.run_briefly() to execute pending calls to really close transports * sslproto: mock also _SSLPipe.shutdown(), it's need to close the transport * pipe test: the test doesn't close explicitly the PipeHandle, so ignore the warning instead * test_popen: use the context manager ("with p:") to explicitly close pipes
* Python issue #23173: sync with TulipVictor Stinner2015-01-141-0/+36
| | | | | | | | * If an exception is raised during the creation of a subprocess, kill the subprocess (close pipes, kill and read the return status). Log an error in such case. * Fix SubprocessStreamProtocol.connection_made() to handle cancelled waiter. Add unit test cancelling subprocess methods.
* asyncio: Truncate to 80 columnsVictor Stinner2015-01-081-1/+3
|
* Issue #23140, asyncio: Simplify the unit testVictor Stinner2015-01-061-8/+6
|
* Issue #23140, asyncio: Fix cancellation of Process.wait(). Check the state ofVictor Stinner2015-01-061-0/+28
| | | | the waiter future before setting its result.
* Issue #22926: In debug mode, call_soon(), call_at() and call_later() methods ofVictor Stinner2014-12-261-19/+3
| | | | | | | | | | asyncio.BaseEventLoop now use the identifier of the current thread to ensure that they are called from the thread running the event loop. Before, the get_event_loop() method was used to check the thread, and no exception was raised when the thread had no event loop. Now the methods always raise an exception in debug mode when called from the wrong thread. It should help to notice misusage of the API.
* asyncio: sync with TulipVictor Stinner2014-12-261-3/+3
| | | | | * 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-4/+8
|
* asyncio, tulip issue 209: Fix subprocess for close_fds=False on Python 3.3Victor Stinner2014-12-111-0/+21
| | | | Mark the write end of the stdin pipe as non-inheritable.
* Issue #22685: Fix test_pause_reading() of asyncio test_subprocessVictor Stinner2014-12-041-0/+2
| | | | | * mock also resume_reading() * ensure that resume_reading() is called
* Issue #22685: Debug test_pause_reading() on FreeBSDVictor Stinner2014-11-281-7/+10
|
* Closes #22685, asyncio: Set the transport of stdout and stderr StreamReaderVictor Stinner2014-11-251-0/+32
| | | | | objects in the SubprocessStreamProtocol. It allows to pause the transport to not buffer too much stdout or stderr data.