]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 30 Jun 2022 09:48:13 +0000 (02:48 -0700)
committerGitHub <noreply@github.com>
Thu, 30 Jun 2022 09:48:13 +0000 (02:48 -0700)
(cherry picked from commit b1ae4af5e82e7275cebcfb383690b816a388a785)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Automerge-Triggered-By: GH:iritkatriel
Lib/test/test_site.py
Lib/test/test_sysconfig.py

index aff3db5d9f49fc5b7695161aa64c55bdfd079c90..93349ed8bb16a3b7a35793841eaed25e07643986 100644 (file)
@@ -205,14 +205,14 @@ 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 "
                           "user-site (site.ENABLE_USER_SITE)")
     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 9408657c9188630f30eb24e9dfa42870d0dd14b3..5ee9839c0487d1ef0bdd5d885f02994dfe6a81b5 100644 (file)
@@ -296,7 +296,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':