[Python-checkins] cpython (3.2): Add test to explicit check the absence regression in subprocess (issue #15592).

andrew.svetlov python-checkins at python.org
Tue Aug 14 17:43:11 CEST 2012


http://hg.python.org/cpython/rev/839bd8f98539
changeset:   78571:839bd8f98539
branch:      3.2
parent:      78564:e0e8e70e4035
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Tue Aug 14 18:35:17 2012 +0300
summary:
  Add test to explicit check the absence regression in subprocess (issue #15592).

Patch by Chris Jerdonek.

files:
  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
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -548,6 +548,18 @@
         (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:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list