1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/tests/functional/test_bad_url.py
Diego Ramirez 02b4f86489
Return a better error message if a file: URL is not found (#10263)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2021-10-08 14:24:54 +01:00

16 lines
602 B
Python

# 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