Skip to content

Commit 226fdce

Browse files
[3.10] GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917) (GH-93970)
(cherry picked from commit b1ae4af) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Automerge-Triggered-By: GH:iritkatriel
1 parent ee93757 commit 226fdce

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
@@ -205,14 +205,14 @@ def test_get_path(self):
205205
scheme = 'osx_framework_user'
206206
else:
207207
scheme = os.name + '_user'
208-
self.assertEqual(site._get_path(site._getuserbase()),
208+
self.assertEqual(os.path.normpath(site._get_path(site._getuserbase())),
209209
sysconfig.get_path('purelib', scheme))
210210

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

218218
env = os.environ.copy()

Lib/test/test_sysconfig.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def test_user_similar(self):
296296
base = base.replace(sys.base_prefix, sys.prefix)
297297
if HAS_USER_BASE:
298298
user_path = get_path(name, 'posix_user')
299-
expected = global_path.replace(base, user, 1)
299+
expected = os.path.normpath(global_path.replace(base, user, 1))
300300
# bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
301301
# whereas posix_prefix does.
302302
if name == 'platlib':

0 commit comments

Comments
 (0)