forked from pypa/pip
-
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.
Return a better error message if a
file:
URL is not found (pypa#10263)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com> Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
- Loading branch information
1 parent
04b9ece
commit 02b4f86
Showing
3 changed files
with
22 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Present a better error message, when a ``file:`` URL is not found. |
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,16 @@ | ||
# test the error message returned by pip when | ||
# a bad "file:" URL is passed to it. | ||
|
||
from typing import Any | ||
|
||
|
||
def test_filenotfound_error_message(script: Any) -> None: | ||
# Test the error message returned when using a bad 'file:' URL. | ||
# make pip to fail and get an error message | ||
# by running "pip install -r file:nonexistent_file" | ||
proc = script.pip("install", "-r", "file:unexistent_file", expect_error=True) | ||
assert proc.returncode == 1 | ||
expect = ( | ||
"ERROR: 404 Client Error: FileNotFoundError for url: file:///unexistent_file" | ||
) | ||
assert proc.stderr.rstrip() == expect |