summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2011-03-15 20:03:32 (GMT)
committerBrett Cannon <brett@python.org>2011-03-15 20:03:32 (GMT)
commit71f1363c349c6ccab38870d328cee4de9081c8f9 (patch)
treef06eaefd5911d935c366b3f5179735648aebee1a /Lib/test/test_subprocess.py
parentb880c1558e8562351e75837e1ba2932ae5d17111 (diff)
parentc15799f88a8add3c40bee7692b525d8a9182e491 (diff)
downloadcpython-71f1363c349c6ccab38870d328cee4de9081c8f9.zip
cpython-71f1363c349c6ccab38870d328cee4de9081c8f9.tar.gz
cpython-71f1363c349c6ccab38870d328cee4de9081c8f9.tar.bz2
merge
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 5e6c40f..5f158b9 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -3,6 +3,7 @@ from test import support
import subprocess
import sys
import signal
+import io
import os
import errno
import tempfile
@@ -1256,6 +1257,24 @@ class POSIXProcessTestCase(BaseTestCase):
close_fds=False, pass_fds=(fd, )))
self.assertIn('overriding close_fds', str(context.warning))
+ def test_stdout_stdin_are_single_inout_fd(self):
+ with io.open(os.devnull, "r+") as inout:
+ p = subprocess.Popen([sys.executable, "-c", "import sys; sys.exit(0)"],
+ stdout=inout, stdin=inout)
+ p.wait()
+
+ def test_stdout_stderr_are_single_inout_fd(self):
+ with io.open(os.devnull, "r+") as inout:
+ p = subprocess.Popen([sys.executable, "-c", "import sys; sys.exit(0)"],
+ stdout=inout, stderr=inout)
+ p.wait()
+
+ def test_stderr_stdin_are_single_inout_fd(self):
+ with io.open(os.devnull, "r+") as inout:
+ p = subprocess.Popen([sys.executable, "-c", "import sys; sys.exit(0)"],
+ stderr=inout, stdin=inout)
+ p.wait()
+
def test_wait_when_sigchild_ignored(self):
# NOTE: sigchild_ignore.py may not be an effective test on all OSes.
sigchild_ignore = support.findfile("sigchild_ignore.py",
@@ -1543,4 +1562,4 @@ def test_main():
support.reap_children()
if __name__ == "__main__":
- test_main()
+ unittest.main()