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

Unified Diff: Lib/test/test_site.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_signal.py ('k') | Lib/test/test_socket.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_site.py Tue Mar 01 10:26:10 2016 +0200
+++ b/Lib/test/test_site.py Wed Mar 02 00:01:35 2016 +0000
@@ -159,16 +159,17 @@ class HelperFunctionsTests(unittest.Test
pth_file.create()
site.addsitedir(pth_file.base_dir, set())
self.pth_file_tests(pth_file)
finally:
pth_file.cleanup()
@unittest.skipUnless(site.ENABLE_USER_SITE, "requires access to PEP 370 "
"user-site (site.ENABLE_USER_SITE)")
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
def test_s_option(self):
usersite = site.USER_SITE
self.assertIn(usersite, sys.path)
env = os.environ.copy()
rc = subprocess.call([sys.executable, '-c',
'import sys; sys.exit(%r in sys.path)' % usersite],
env=env)
@@ -316,16 +317,17 @@ class ImportSideEffectTests(unittest.Tes
def setUp(self):
"""Make a copy of sys.path"""
self.sys_path = sys.path[:]
def tearDown(self):
"""Restore sys.path"""
sys.path[:] = self.sys_path
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
def test_abs_paths(self):
# Make sure all imported modules have their __file__ and __cached__
# attributes as absolute paths. Arranging to put the Lib directory on
# PYTHONPATH would cause the os module to have a relative path for
# __file__ if abs_paths() does not get run. sys and builtins (the
# only other modules imported before site.py runs) do not have
# __file__ or __cached__ because they are built-in.
parent = os.path.relpath(os.path.dirname(os.__file__))
@@ -431,16 +433,17 @@ class ImportSideEffectTests(unittest.Tes
code = data.getcode()
except urllib.error.HTTPError as e:
code = e.code
self.assertEqual(code, 200, msg="Can't find " + url)
class StartupImportTests(unittest.TestCase):
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
def test_startup_imports(self):
# This tests checks which modules are loaded by Python when it
# initially starts upon startup.
popen = subprocess.Popen([sys.executable, '-I', '-v', '-c',
'import sys; print(set(sys.modules))'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = popen.communicate()
« no previous file with comments | « Lib/test/test_signal.py ('k') | Lib/test/test_socket.py » ('j') | no next file with comments »

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