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

Unified Diff: Lib/test/test_platform.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_pipes.py ('k') | Lib/test/test_poll.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_platform.py Tue Mar 01 10:26:10 2016 +0200
+++ b/Lib/test/test_platform.py Wed Mar 02 00:01:35 2016 +0000
@@ -9,16 +9,17 @@ import warnings
from test import support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
@support.skip_unless_symlink
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
def test_architecture_via_symlink(self): # issue3762
# On Windows, the EXE needs to know where pythonXY.dll is at so we have
# to add the directory to the path.
if sys.platform == "win32":
os.environ["Path"] = "{};{}".format(
os.path.dirname(sys.executable), os.environ["Path"])
def get(python):
@@ -182,17 +183,17 @@ class PlatformTest(unittest.TestCase):
self.assertTrue(all(res))
def test_win32_ver(self):
res = platform.win32_ver()
def test_mac_ver(self):
res = platform.mac_ver()
- if platform.uname().system == 'Darwin':
+ if platform.uname().system == 'Darwin' and sys.platform != 'ios':
# We're on a MacOSX system, check that
# the right version information is returned
fd = os.popen('sw_vers', 'r')
real_ver = None
for ln in fd:
if ln.startswith('ProductVersion:'):
real_ver = ln.strip().split()[-1]
break
@@ -267,16 +268,17 @@ class PlatformTest(unittest.TestCase):
('Red Hat Linux release 9 (Shrike)', ('Red Hat Linux', '9', 'Shrike')),
('Red Hat Enterprise Linux release 4 (Nahant)', ('Red Hat Enterprise Linux', '4', 'Nahant')),
('CentOS release 4', ('CentOS', '4', None)),
('Rocks release 4.2.1 (Cydonia)', ('Rocks', '4.2.1', 'Cydonia')),
('', ('', '', '')), # If there's nothing there.
):
self.assertEqual(platform._parse_release_file(input), output)
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
def test_popen(self):
mswindows = (sys.platform == "win32")
if mswindows:
command = '"{}" -c "print(\'Hello\')"'.format(sys.executable)
else:
command = "'{}' -c 'print(\"Hello\")'".format(sys.executable)
with warnings.catch_warnings():
« no previous file with comments | « Lib/test/test_pipes.py ('k') | Lib/test/test_poll.py » ('j') | no next file with comments »

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