Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(79177)

Unified Diff: Lib/test/test_popen.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_poll.py ('k') | Lib/test/test_posix.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_popen.py Tue Mar 01 10:26:10 2016 +0200
+++ b/Lib/test/test_popen.py Wed Mar 02 00:01:35 2016 +0000
@@ -1,26 +1,28 @@
"""Basic tests for os.popen()
Particularly useful for platforms that fake popen.
"""
import unittest
from test import support
import os, sys
+import subprocess
# Test that command-lines get down as we expect.
# To do this we execute:
# python -c "import sys;print(sys.argv)" {rest_of_commandline}
# This results in Python being spawned and printing the sys.argv list.
# We can then eval() the result of this, and see what each argv was.
python = sys.executable
if ' ' in python:
python = '"' + python + '"' # quote embedded space for cmdline
+@unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
class PopenTest(unittest.TestCase):
def _do_test_commandline(self, cmdline, expected):
cmd = '%s -c "import sys; print(sys.argv)" %s'
cmd = cmd % (python, cmdline)
with os.popen(cmd) as p:
data = p.read()
got = eval(data)[1:] # strip off argv[0]
« no previous file with comments | « Lib/test/test_poll.py ('k') | Lib/test/test_posix.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+