cpython: 0df5aeab229f (original) (raw)
Mercurial > cpython
changeset 79499:0df5aeab229f 3.3
Issue #16115: Add test for check that executable arg to Popen() takes precedence over args[0] arg\n \n Patch by Kushal Das [#16115]
Andrew Svetlov andrew.svetlov@gmail.com | |
---|---|
date | Fri, 05 Oct 2012 22:52:15 +0300 |
parents | 5ae9a90811ff |
children | 0fcfb6066e17 ee71d8023f1b |
files | Lib/test/test_subprocess.py |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-)[+] [-] Lib/test/test_subprocess.py 10 |
line wrap: on
line diff
--- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -299,6 +299,16 @@ class ProcessTestCase(BaseTestCase): # argument. For test runs in the build directory, see #7774. self._assert_cwd('', "somethingyoudonthave", executable=sys.executable)
- def test_executable_precedence(self):
# To the precedence of executable argument over args[0][](#l1.8)
# For a normal installation, it should work without 'cwd'[](#l1.9)
# argument. For test runs in the build directory, see #7774.[](#l1.10)
python_dir = os.path.dirname(os.path.realpath(sys.executable))[](#l1.11)
p = subprocess.Popen(["nonexistent","-c",'import sys; sys.exit(42)'],[](#l1.12)
executable=sys.executable, cwd=python_dir)[](#l1.13)
p.wait()[](#l1.14)
self.assertEqual(p.returncode, 42)[](#l1.15)
+ def test_stdin_pipe(self): # stdin redirection p = subprocess.Popen([sys.executable, "-c",