summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_getpath.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2023-01-16 16:05:39 (GMT)
committerGitHub <noreply@github.com>2023-01-16 16:05:39 (GMT)
commitdf10571a130c46d67756239e76ad69a3d730a990 (patch)
treeeaf35ef5f611dee9898abbb5b6aefa0e51fa22d2 /Lib/test/test_getpath.py
parent7b14c2ef194b6eed79670aa9d7e29ab8e2256a56 (diff)
downloadcpython-df10571a130c46d67756239e76ad69a3d730a990.zip
cpython-df10571a130c46d67756239e76ad69a3d730a990.tar.gz
cpython-df10571a130c46d67756239e76ad69a3d730a990.tar.bz2
gh-100320: Fix path calculations on Windows when python.exe is moved outside of the normal location (GH-100947)
Diffstat (limited to 'Lib/test/test_getpath.py')
-rw-r--r--Lib/test/test_getpath.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/Lib/test/test_getpath.py b/Lib/test/test_getpath.py
index bdcf4a3..b9cbe1d 100644
--- a/Lib/test/test_getpath.py
+++ b/Lib/test/test_getpath.py
@@ -37,8 +37,9 @@ class MockGetPathTests(unittest.TestCase):
module_search_paths_set=1,
module_search_paths=[
r"C:\Python\python98.zip",
- r"C:\Python\Lib",
r"C:\Python\DLLs",
+ r"C:\Python\Lib",
+ r"C:\Python",
],
)
actual = getpath(ns, expected)
@@ -63,8 +64,8 @@ class MockGetPathTests(unittest.TestCase):
module_search_paths_set=1,
module_search_paths=[
r"C:\CPython\PCbuild\amd64\python98.zip",
- r"C:\CPython\Lib",
r"C:\CPython\PCbuild\amd64",
+ r"C:\CPython\Lib",
],
)
actual = getpath(ns, expected)
@@ -133,8 +134,9 @@ class MockGetPathTests(unittest.TestCase):
r"C:\Python\python98.zip",
"path1-dir",
# should not contain not-subdirs
- r"C:\Python\Lib",
r"C:\Python\DLLs",
+ r"C:\Python\Lib",
+ r"C:\Python",
],
)
actual = getpath(ns, expected)
@@ -147,8 +149,9 @@ class MockGetPathTests(unittest.TestCase):
module_search_paths_set=1,
module_search_paths=[
r"C:\Python\python98.zip",
- r"C:\Python\Lib",
r"C:\Python\DLLs",
+ r"C:\Python\Lib",
+ r"C:\Python",
],
)
actual = getpath(ns, expected)
@@ -173,8 +176,9 @@ class MockGetPathTests(unittest.TestCase):
module_search_paths_set=1,
module_search_paths=[
r"C:\Python\python98.zip",
- r"C:\Python\Lib",
r"C:\Python\DLLs",
+ r"C:\Python\Lib",
+ r"C:\Python",
],
)
actual = getpath(ns, expected)
@@ -201,8 +205,8 @@ class MockGetPathTests(unittest.TestCase):
module_search_paths_set=1,
module_search_paths=[
r"C:\CPython\PCbuild\amd64\python98.zip",
- r"C:\CPython\Lib",
r"C:\CPython\PCbuild\amd64",
+ r"C:\CPython\Lib",
],
)
actual = getpath(ns, expected)
@@ -231,8 +235,8 @@ class MockGetPathTests(unittest.TestCase):
module_search_paths_set=1,
module_search_paths=[
r"C:\Out\python98.zip",
- r"C:\CPython\Lib",
r"C:\Out",
+ r"C:\CPython\Lib",
],
)
actual = getpath(ns, expected)
@@ -254,8 +258,8 @@ class MockGetPathTests(unittest.TestCase):
module_search_paths_set=1,
module_search_paths=[
r"C:\Python\python98.zip",
- r"C:\Python\Lib",
r"C:\Python",
+ r"C:\Python\Lib",
],
)
actual = getpath(ns, expected)