Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_subprocess.py @ 61793:441491572fce
Issue #8780: Fix a regression introduced by r78946 in subprocess on Windows
Ensure that stdout / stderr is inherited from the parent if stdout=PIPE /
stderr=PIPE is not used.
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Fri, 21 May 2010 20:13:12 +0000 |
| parents | cf74ec3e1f82 |
| children | ef8a2ab26e9f |
line wrap: on
line diff
--- a/Lib/test/test_subprocess.py Fri May 21 17:25:34 2010 +0000 +++ b/Lib/test/test_subprocess.py Fri May 21 20:13:12 2010 +0000 @@ -535,6 +535,17 @@ if c.exception.errno != 2: # ignore "no such file" raise c.exception + def test_issue8780(self): + # Ensure that stdout is inherited from the parent + # if stdout=PIPE is not used + code = ';'.join(( + 'import subprocess, sys', + 'retcode = subprocess.call(' + "[sys.executable, '-c', 'print(\"Hello World!\")'])", + 'assert retcode == 0')) + output = subprocess.check_output([sys.executable, '-c', code]) + self.assert_(output.startswith(b'Hello World!'), ascii(output)) + # context manager class _SuppressCoreFiles(object):
