]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Fri, 17 Jun 2022 22:28:23 +0000 (23:28 +0100)
committerGitHub <noreply@github.com>
Fri, 17 Jun 2022 22:28:23 +0000 (23:28 +0100)
Lib/test/test_site.py
Lib/test/test_sysconfig.py

index e66a2db7e9b3c43dae6ca98cbc0190120e4b3988..6822579ad2a50d6c6453d21a776acdebe9a42eff 100644 (file)
@@ -205,7 +205,7 @@ class HelperFunctionsTests(unittest.TestCase):
             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 "
@@ -213,7 +213,7 @@ class HelperFunctionsTests(unittest.TestCase):
     @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()
index c00d7d5b5024f483eaf5f8021c5167d9b1d225ba..27722fbe11ee1751f626e80251484e51044b36e3 100644 (file)
@@ -369,7 +369,7 @@ class TestSysConfig(unittest.TestCase):
                 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':