diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-06-30 09:47:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 09:47:16 (GMT) |
commit | c5ecfa0a1e5334be21ca3448abf87aabc534a97e (patch) | |
tree | 1b75fb1521781069829985433acf8d09da8f9c76 | |
parent | 5084a64d38ba83cf65d74e25fee0c6d612d4edc3 (diff) | |
download | cpython-c5ecfa0a1e5334be21ca3448abf87aabc534a97e.zip cpython-c5ecfa0a1e5334be21ca3448abf87aabc534a97e.tar.gz cpython-c5ecfa0a1e5334be21ca3448abf87aabc534a97e.tar.bz2 |
[3.11] GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917) (GH-93969)
(cherry picked from commit b1ae4af5e82e7275cebcfb383690b816a388a785)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Automerge-Triggered-By: GH:iritkatriel
-rw-r--r-- | Lib/test/test_site.py | 4 | ||||
-rw-r--r-- | Lib/test/test_sysconfig.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 9a148fe..b5dc381 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -206,7 +206,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 " @@ -214,7 +214,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() diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 1679700..83b492e 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -370,7 +370,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': |