Skip to content

Commit c5ecfa0

Browse files
[3.11] GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917) (GH-93969)
(cherry picked from commit b1ae4af) Co-authored-by: Irit Katriel <[email protected]> Automerge-Triggered-By: GH:iritkatriel
1 parent 5084a64 commit c5ecfa0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/test/test_site.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ def test_get_path(self):
206206
scheme = 'osx_framework_user'
207207
else:
208208
scheme = os.name + '_user'
209-
self.assertEqual(site._get_path(site._getuserbase()),
209+
self.assertEqual(os.path.normpath(site._get_path(site._getuserbase())),
210210
sysconfig.get_path('purelib', scheme))
211211

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

220220
env = os.environ.copy()

Lib/test/test_sysconfig.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def test_user_similar(self):
370370
base = base.replace(sys.base_prefix, sys.prefix)
371371
if HAS_USER_BASE:
372372
user_path = get_path(name, 'posix_user')
373-
expected = global_path.replace(base, user, 1)
373+
expected = os.path.normpath(global_path.replace(base, user, 1))
374374
# bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
375375
# whereas posix_prefix does.
376376
if name == 'platlib':

0 commit comments

Comments
 (0)