[3.11] GH-77403: Fix tests which fail when PYTHONUSERBASE is not norm… · python/cpython@c5ecfa0

GitHub

Original file line numberDiff line numberDiff line change@@ -206,15 +206,15 @@ def test_get_path(self):

206206scheme='osx_framework_user'

207207else:

208208scheme=os.name+'_user'

209-self.assertEqual(site._get_path(site._getuserbase()),

209+self.assertEqual(os.path.normpath(site._get_path(site._getuserbase())),

210210sysconfig.get_path('purelib', scheme))

[email protected](site.ENABLE_USER_SITE, "requires access to PEP 370 "

213213"user-site (site.ENABLE_USER_SITE)")

[email protected]_subprocess()

215215deftest_s_option(self):

216216# (ncoghlan) Change this to use script_helper...

217-usersite=site.USER_SITE

217+usersite=os.path.normpath(site.USER_SITE)

218218self.assertIn(usersite, sys.path)

219219220220env=os.environ.copy()

Original file line numberDiff line numberDiff line change@@ -370,7 +370,7 @@ def test_user_similar(self):

370370base=base.replace(sys.base_prefix, sys.prefix)

371371ifHAS_USER_BASE:

372372user_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.

376376ifname=='platlib':