Skip to content
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

GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized #93917

Merged
merged 1 commit into from
Jun 17, 2022
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
4 changes: 2 additions & 2 deletions Lib/test/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ def test_get_path(self):
scheme = 'osx_framework_user'
else:
scheme = os.name + '_user'
self.assertEqual(site._get_path(site._getuserbase()),
self.assertEqual(os.path.normpath(site._get_path(site._getuserbase())),
sysconfig.get_path('purelib', scheme))

@unittest.skipUnless(site.ENABLE_USER_SITE, "requires access to PEP 370 "
"user-site (site.ENABLE_USER_SITE)")
@support.requires_subprocess()
def test_s_option(self):
# (ncoghlan) Change this to use script_helper...
usersite = site.USER_SITE
usersite = os.path.normpath(site.USER_SITE)
self.assertIn(usersite, sys.path)

env = os.environ.copy()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def test_user_similar(self):
base = base.replace(sys.base_prefix, sys.prefix)
if HAS_USER_BASE:
user_path = get_path(name, 'posix_user')
expected = global_path.replace(base, user, 1)
expected = os.path.normpath(global_path.replace(base, user, 1))
# bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
# whereas posix_prefix does.
if name == 'platlib':
Expand Down