mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
bpo-44860: Update test_sysconfig for posix_user platlib (GH-28235) (GH-28251)
Update test_sysconfig.test_user_similar() for the posix_user scheme:
"platlib" doesn't use sys.platlibdir.
(cherry picked from commit 49acac00c0)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
c081866971
commit
11103eb1f2
3 changed files with 14 additions and 1 deletions
|
|
@ -96,6 +96,7 @@ def collect_sys(info_add):
|
||||||
'maxunicode',
|
'maxunicode',
|
||||||
'path',
|
'path',
|
||||||
'platform',
|
'platform',
|
||||||
|
'platlibdir',
|
||||||
'prefix',
|
'prefix',
|
||||||
'thread_info',
|
'thread_info',
|
||||||
'version',
|
'version',
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,17 @@ def test_user_similar(self):
|
||||||
base = base.replace(sys.base_prefix, sys.prefix)
|
base = base.replace(sys.base_prefix, sys.prefix)
|
||||||
if HAS_USER_BASE:
|
if HAS_USER_BASE:
|
||||||
user_path = get_path(name, 'posix_user')
|
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):
|
def test_main(self):
|
||||||
# just making sure _main() runs and returns things in the stdout
|
# just making sure _main() runs and returns things in the stdout
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
Update ``test_sysconfig.test_user_similar()`` for the posix_user scheme:
|
||||||
|
``platlib`` doesn't use :data:`sys.platlibdir`. Patch by Victor Stinner.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue