Skip to content
Merged
Prev Previous commit
Next Next commit
Fix test (place a landmark)
  • Loading branch information
neonene committed Jun 11, 2022
commit f336113b257d682943a301bd711946042b34a39b
6 changes: 4 additions & 2 deletions Lib/test/test_getpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,23 @@ def update_pathconfig(config, attr):
if config[attr] > 0:
_Py_path_config[attr] = config[attr]

for edges in [(0,-1), (-1, 0), (-1,-1), (1, 0)]:
for edges in [(0,-1), (-1, 0), (-1,-1)]:
_Py_path_config = dict(
_is_python_build=edges[0],
)
ns = MockNTNamespace(
argv0=r"C:\CPython\PCbuild\amd64\python.exe",
)
ns.add_known_file(r"C:\CPython\PCbuild\amd64\pybuilddir.txt", [""])
ns['config'].update(
home=r"C:\CPython", # turn on 'home_was_set'
_is_python_build=edges[1],
)
# _PyConfig_InitPathConfig emulation
read_pathconfig(ns['config'], '_is_python_build')
expected = dict(
_is_python_build=ns['config']['_is_python_build'],
build_prefix=None, # no build-landmark
build_prefix=None, # landmarks must not be checked
)
actual = getpath(ns, expected)
self.assertEqual(actual, expected)
Expand Down