1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Add test_error_all_yanked_files_and_no_pin test

This commit is contained in:
Alberto Sottile 2021-11-06 16:22:56 +01:00
parent 6b62c28060
commit 99cb1e0fc3
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,7 @@
<html>
<body>
<a data-yanked="test reason message" href="../../../packages/simple-1.0.tar.gz">simple-1.0.tar.gz</a>
<a data-yanked="test reason message" href="../../../packages/simple-2.0.tar.gz">simple-2.0.tar.gz</a>
<a data-yanked="test reason message" href="../../../packages/simple-3.0.tar.gz">simple-3.0.tar.gz</a>
</body>
</html>

View file

@ -2030,6 +2030,24 @@ def test_install_yanked_file_and_print_warning(script, data):
assert "Successfully installed simple-3.0\n" in result.stdout, str(result)
def test_error_all_yanked_files_and_no_pin(script, data):
"""
Test raising an error if there are only "yanked" files available and no pin
"""
result = script.pip(
"install",
"simple",
"--index-url",
data.index_url("yanked_all"),
expect_error=True
)
# Make sure an error is raised
assert (
result.returncode == 1
and "ERROR: No matching distribution found for simple\n" in result.stderr
), str(result)
@pytest.mark.parametrize(
"install_args",
[