Skip to content

gh-75229: make ensurepip honour value of --prefix option #135488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix ensurepip tests to match new --executable argument behavior
Update test expectations in test_ensurepip.py to account for the new
--executable argument that gets added when using --prefix or --root
options. The implementation now correctly sets the executable path
when installing with a custom prefix, but the tests weren't updated
to expect this additional argument.

- test_bootstrapping_with_root: expect --prefix "/" and --executable
- test_bootstrapping_with_prefix: expect --executable argument
  • Loading branch information
mcepl committed Aug 7, 2025
commit 03d9ad80e03a8476b8ef57ac6ce3b15df159359f
6 changes: 4 additions & 2 deletions Lib/test/test_ensurepip.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def test_bootstrapping_with_root(self):
self.run_pip.assert_called_once_with(
[
"install", "--no-cache-dir", "--no-index", "--find-links",
unittest.mock.ANY, "--root", "/foo/bar/", "--prefix", unittest.mock.ANY,
unittest.mock.ANY, "--root", "/foo/bar/", "--prefix", "/",
"--executable", unittest.mock.ANY,
"pip",
],
unittest.mock.ANY,
Expand All @@ -105,7 +106,8 @@ def test_bootstrapping_with_prefix(self):
self.run_pip.assert_called_once_with(
[
"install", "--no-cache-dir", "--no-index", "--find-links",
unittest.mock.ANY, "--prefix", "/foo/bar/", "pip",
unittest.mock.ANY, "--prefix", "/foo/bar/",
"--executable", unittest.mock.ANY, "pip",
],
unittest.mock.ANY,
)
Expand Down
Loading