Skip to content

Commit bfab215

Browse files
committed
Add a test to ensure invalid wheel versions are handled reasonably
1 parent cb3d40e commit bfab215

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/functional/test_install_wheel.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,3 +762,23 @@ def test_wheel_with_unknown_subdir_in_data_dir_has_reasonable_error(
762762

763763
result = script.pip("install", "--no-index", str(wheel_path), expect_error=True)
764764
assert "simple-0.1.0.data/unknown/hello.txt" in result.stderr
765+
766+
767+
def test_wheel_with_invalid_version_has_reasonable_error(
768+
script: PipTestEnvironment, tmpdir: Path
769+
) -> None:
770+
make_wheel(
771+
name="futurewheel",
772+
version="0.3.0.f038176.11",
773+
).save_to_dir(tmpdir)
774+
775+
result = script.pip(
776+
"install",
777+
"--no-index",
778+
"--find-links",
779+
str(tmpdir),
780+
"futurewheel==0.3.0.f038176.11",
781+
expect_error=True,
782+
)
783+
assert "Got invalid version" in result.stderr
784+
assert "PEP 440" in result.stderr

0 commit comments

Comments
 (0)