Skip to content

Commit b1ae4af

Browse files
authored
GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917)
1 parent 71354ad commit b1ae4af

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/test/test_site.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,15 @@ 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
@support.requires_subprocess()
214214
def test_s_option(self):
215215
# (ncoghlan) Change this to use script_helper...
216-
usersite = site.USER_SITE
216+
usersite = os.path.normpath(site.USER_SITE)
217217
self.assertIn(usersite, sys.path)
218218

219219
env = os.environ.copy()

Lib/test/test_sysconfig.py

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy