summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-09-09 09:02:48 (GMT)
committerGitHub <noreply@github.com>2021-09-09 09:02:48 (GMT)
commit49acac00c08838d8080ce00d02c05284b94f8fb2 (patch)
treee927ee9783c0ab338c5bed2e2acd459b4514bfd1 /Lib
parentb7bb54fc10ed994d86efc425b6f667ffa6660392 (diff)
downloadcpython-49acac00c08838d8080ce00d02c05284b94f8fb2.zip
cpython-49acac00c08838d8080ce00d02c05284b94f8fb2.tar.gz
cpython-49acac00c08838d8080ce00d02c05284b94f8fb2.tar.bz2
bpo-44860: Update test_sysconfig for posix_user platlib (GH-28235)
Update test_sysconfig.test_user_similar() for the posix_user scheme: "platlib" doesn't use sys.platlibdir.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/pythoninfo.py1
-rw-r--r--Lib/test/test_sysconfig.py12
2 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 278dfe7..39ee9e1 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -96,6 +96,7 @@ def collect_sys(info_add):
'maxunicode',
'path',
'platform',
+ 'platlibdir',
'prefix',
'thread_info',
'version',
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index b8b9add..9408657 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -296,7 +296,17 @@ class TestSysConfig(unittest.TestCase):
base = base.replace(sys.base_prefix, sys.prefix)
if HAS_USER_BASE:
user_path = get_path(name, 'posix_user')
- self.assertEqual(user_path, global_path.replace(base, user, 1))
+ expected = global_path.replace(base, user, 1)
+ # bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
+ # whereas posix_prefix does.
+ if name == 'platlib':
+ # Replace "/lib64/python3.11/site-packages" suffix
+ # with "/lib/python3.11/site-packages".
+ py_version_short = sysconfig.get_python_version()
+ suffix = f'python{py_version_short}/site-packages'
+ expected = expected.replace(f'/{sys.platlibdir}/{suffix}',
+ f'/lib/{suffix}')
+ self.assertEqual(user_path, expected)
def test_main(self):
# just making sure _main() runs and returns things in the stdout