diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-08-14 15:35:17 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-08-14 15:35:17 (GMT) |
commit | f3765071eb73ffb3630a64987f7dceddf64be2ea (patch) | |
tree | d13dd4f0c3148b67963409dcb7ce22813dd517ac /Lib/test/test_subprocess.py | |
parent | f158d86074465914c8de22e357c17090eb959da4 (diff) | |
download | cpython-f3765071eb73ffb3630a64987f7dceddf64be2ea.zip cpython-f3765071eb73ffb3630a64987f7dceddf64be2ea.tar.gz cpython-f3765071eb73ffb3630a64987f7dceddf64be2ea.tar.bz2 |
Add test to explicit check the absence regression in subprocess (issue #15592).
Patch by Chris Jerdonek.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 52de5c0..9e92a96 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -548,6 +548,18 @@ class ProcessTestCase(BaseTestCase): (stdout, stderr) = p.communicate("line1\nline3\n") self.assertEqual(p.returncode, 0) + def test_universal_newlines_communicate_input_none(self): + # Test communicate(input=None) with universal newlines. + # + # We set stdout to PIPE because, as of this writing, a different + # code path is tested when the number of pipes is zero or one. + p = subprocess.Popen([sys.executable, "-c", "pass"], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + universal_newlines=True) + p.communicate() + self.assertEqual(p.returncode, 0) + def test_no_leaking(self): # Make sure we leak no resources if not mswindows: |