summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2011-03-16 17:55:58 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2011-03-16 17:55:58 (GMT)
commit1d7a8879c6fb88e423828438875ae920ac1f9677 (patch)
treedb8723796b68f10cf261b8d413279cb2a7d534a2 /Lib/test/test_subprocess.py
parent7bfa67f380c1de301293a3ff4baeffb56b42b70c (diff)
parentba102ec10d953af825e0da4c3cff02a701d3ca81 (diff)
downloadcpython-1d7a8879c6fb88e423828438875ae920ac1f9677.zip
cpython-1d7a8879c6fb88e423828438875ae920ac1f9677.tar.gz
cpython-1d7a8879c6fb88e423828438875ae920ac1f9677.tar.bz2
Merge from remote
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 5f158b9..3156543 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -323,6 +323,31 @@ class ProcessTestCase(BaseTestCase):
rc = subprocess.call([sys.executable, "-c", cmd], stdout=1)
self.assertEqual(rc, 2)
+ def test_stdout_devnull(self):
+ p = subprocess.Popen([sys.executable, "-c",
+ 'for i in range(10240):'
+ 'print("x" * 1024)'],
+ stdout=subprocess.DEVNULL)
+ p.wait()
+ self.assertEqual(p.stdout, None)
+
+ def test_stderr_devnull(self):
+ p = subprocess.Popen([sys.executable, "-c",
+ 'import sys\n'
+ 'for i in range(10240):'
+ 'sys.stderr.write("x" * 1024)'],
+ stderr=subprocess.DEVNULL)
+ p.wait()
+ self.assertEqual(p.stderr, None)
+
+ def test_stdin_devnull(self):
+ p = subprocess.Popen([sys.executable, "-c",
+ 'import sys;'
+ 'sys.stdin.read(1)'],
+ stdin=subprocess.DEVNULL)
+ p.wait()
+ self.assertEqual(p.stdin, None)
+
def test_cwd(self):
tmpdir = tempfile.gettempdir()
# We cannot use os.path.realpath to canonicalize the path,