Skip to content

[3.10] bpo-44860: Update test_sysconfig for posix_user platlib (GH-28235) #28251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Lib/test/pythoninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def collect_sys(info_add):
'maxunicode',
'path',
'platform',
'platlibdir',
'prefix',
'thread_info',
'version',
Expand Down
12 changes: 11 additions & 1 deletion Lib/test/test_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,17 @@ def test_user_similar(self):
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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.