Author: Philip Jenvey <pjen...@underboss.org> Branch: py3k Changeset: r84438:bf01b0f20608 Date: 2016-05-14 13:25 -0700 http://bitbucket.org/pypy/pypy/changeset/bf01b0f20608/
Log: reapply lost changes from default/pypy3.2 diff --git a/lib-python/3/test/test_site.py b/lib-python/3/test/test_site.py --- a/lib-python/3/test/test_site.py +++ b/lib-python/3/test/test_site.py @@ -6,7 +6,8 @@ """ import unittest import test.support -from test.support import captured_stderr, TESTFN, EnvironmentVarGuard +from test.support import ( + captured_stderr, check_impl_detail, TESTFN, EnvironmentVarGuard) import builtins import os import sys @@ -234,6 +235,10 @@ self.assertEqual(len(dirs), 1) wanted = os.path.join('xoxo', 'Lib', 'site-packages') self.assertEqual(dirs[0], wanted) + elif check_impl_detail(pypy=True): + self.assertEqual(len(dirs), 1) + wanted = os.path.join('xoxo', 'site-packages') + self.assertEqual(dirs[0], wanted) elif (sys.platform == "darwin" and sysconfig.get_config_var("PYTHONFRAMEWORK")): # OS X framework builds @@ -352,8 +357,10 @@ self.assertEqual(proc.returncode, 0) os__file__, os__cached__ = stdout.splitlines()[:2] - self.assertFalse(os.path.isabs(os__file__)) - self.assertFalse(os.path.isabs(os__cached__)) + if check_impl_detail(cpython=True): + # XXX: should probably match cpython + self.assertFalse(os.path.isabs(os__file__)) + self.assertFalse(os.path.isabs(os__cached__)) # Now, with 'import site', it works. proc = subprocess.Popen([sys.executable, '-c', command], env=env, diff --git a/lib-python/3/test/test_sysconfig.py b/lib-python/3/test/test_sysconfig.py --- a/lib-python/3/test/test_sysconfig.py +++ b/lib-python/3/test/test_sysconfig.py @@ -6,7 +6,8 @@ from copy import copy from test.support import (run_unittest, TESTFN, unlink, - captured_stdout, skip_unless_symlink) + captured_stdout, impl_detail, import_module, + skip_unless_symlink) import sysconfig from sysconfig import (get_paths, get_platform, get_config_vars, @@ -231,7 +232,10 @@ def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() - self.assertTrue(os.path.isfile(config_h), config_h) + # import_module skips the test when the CPython C Extension API + # appears to not be supported + self.assertTrue(os.path.isfile(config_h) or + not import_module('_testcapi'), config_h) def test_get_scheme_names(self): wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user', @@ -288,6 +292,7 @@ _main() self.assertTrue(len(output.getvalue().split('\n')) > 0) + @impl_detail("PyPy lacks LDFLAGS/LDSHARED config vars", pypy=False) @unittest.skipIf(sys.platform == "win32", "Does not apply to Windows") def test_ldshared_value(self): ldflags = sysconfig.get_config_var('LDFLAGS') @@ -374,6 +379,7 @@ class MakefileTests(unittest.TestCase): + @impl_detail("PyPy lacks sysconfig.get_makefile_filename", pypy=False) @unittest.skipIf(sys.platform.startswith('win'), 'Test is not Windows compatible') def test_get_makefile_filename(self): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit