-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pypa#12666 by pre-loading script wrapper code
- Loading branch information
Showing
2 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Check that pip can update itself correctly | ||
|
||
from typing import Any | ||
|
||
|
||
def test_self_update_editable(script: Any, pip_src: Any) -> None: | ||
# Test that if we have an environment with pip installed in non-editable | ||
# mode, that pip can safely update itself to an editable install. | ||
# See https://github.com/pypa/pip/issues/12666 for details. | ||
|
||
# Step 1. Install pip as non-editable. This is expected to succeed as | ||
# the existing pip in the environment is installed in editable mode, so | ||
# it only places a .pth file in the environment. | ||
proc = script.pip("install", pip_src) | ||
assert proc.returncode == 0 | ||
# Step 2. Using the pip we just installed, install pip *again*, but | ||
# in editable mode. This could fail, as we'll need to uninstall the running | ||
# pip in order to install the new copy, and uninstalling pip while it's | ||
# running could fail. This test is specifically to ensure that doesn't | ||
# happen... | ||
proc = script.pip("install", "-e", pip_src) | ||
assert proc.returncode == 0 |