summaryrefslogtreecommitdiff
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorTim Golden <mail@timgolden.me.uk>2013-11-03 12:55:51 +0000
committerTim Golden <mail@timgolden.me.uk>2013-11-03 12:55:51 +0000
commitab7211f27847ab4e0090cc6bfb815bff4400c898 (patch)
tree4299768bf0f4e9f4c544bc9f49f6d01545eae941 /Lib/test/test_subprocess.py
parent7df4ddde15d654d557c3c0f8f1ee24a52e82f475 (diff)
parente004175c5694804c263f0f06e7a4e3bbc6852cc4 (diff)
downloadcpython-git-ab7211f27847ab4e0090cc6bfb815bff4400c898.tar.gz
Issue #10197 Rework subprocess.get[status]output to use subprocess functionality and thus to work on Windows. Patch by Nick Coghlan.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 840577dba1..cdcee9fd0b 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2158,13 +2158,6 @@ class Win32ProcessTestCase(BaseTestCase):
def test_terminate_dead(self):
self._kill_dead_process('terminate')
-
-# The module says:
-# "NB This only works (and is only relevant) for UNIX."
-#
-# Actually, getoutput should work on any platform with an os.popen, but
-# I'll take the comment as given, and skip this suite.
-@unittest.skipUnless(os.name == 'posix', "only relevant for UNIX")
class CommandTests(unittest.TestCase):
def test_getoutput(self):
self.assertEqual(subprocess.getoutput('echo xyzzy'), 'xyzzy')
@@ -2178,8 +2171,8 @@ class CommandTests(unittest.TestCase):
try:
dir = tempfile.mkdtemp()
name = os.path.join(dir, "foo")
-
- status, output = subprocess.getstatusoutput('cat ' + name)
+ status, output = subprocess.getstatusoutput(
+ ("type " if mswindows else "cat ") + name)
self.assertNotEqual(status, 0)
finally:
if dir is not None: