|
4 | 4 |
|
5 | 5 | from pip._internal.exceptions import InvalidWheelFilename
|
6 | 6 | from pip._internal.models.wheel import Wheel
|
7 |
| -from pip._internal.utils import compatibility_tags, deprecation |
| 7 | +from pip._internal.utils import compatibility_tags |
8 | 8 |
|
9 | 9 |
|
10 | 10 | class TestWheelFile:
|
@@ -47,9 +47,8 @@ def test_single_digit_version(self) -> None:
|
47 | 47 | assert w.version == "1"
|
48 | 48 |
|
49 | 49 | def test_non_pep440_version(self) -> None:
|
50 |
| - with pytest.warns(deprecation.PipDeprecationWarning): |
51 |
| - w = Wheel("simple-_invalid_-py2-none-any.whl") |
52 |
| - assert w.version == "-invalid-" |
| 50 | + with pytest.raises(InvalidWheelFilename): |
| 51 | + Wheel("simple-_invalid_-py2-none-any.whl") |
53 | 52 |
|
54 | 53 | def test_missing_version_raises(self) -> None:
|
55 | 54 | with pytest.raises(InvalidWheelFilename):
|
@@ -254,16 +253,14 @@ def test_support_index_min__none_supported(self) -> None:
|
254 | 253 |
|
255 | 254 | def test_version_underscore_conversion(self) -> None:
|
256 | 255 | """
|
257 |
| - Test that we convert '_' to '-' for versions parsed out of wheel |
258 |
| - filenames |
| 256 | + Test that underscore versions are now invalid (no longer converted) |
259 | 257 | """
|
260 |
| - with pytest.warns(deprecation.PipDeprecationWarning): |
261 |
| - w = Wheel("simple-0.1_1-py2-none-any.whl") |
262 |
| - assert w.version == "0.1-1" |
| 258 | + with pytest.raises(InvalidWheelFilename): |
| 259 | + Wheel("simple-0.1_1-py2-none-any.whl") |
263 | 260 |
|
264 |
| - def test_invalid_wheel_warning(self) -> None: |
| 261 | + def test_invalid_wheel_raises(self) -> None: |
265 | 262 | """
|
266 |
| - Test that wheel with invalid name produces warning |
| 263 | + Test that wheel with invalid name now raises exception |
267 | 264 | """
|
268 |
| - with pytest.warns(deprecation.PipDeprecationWarning): |
| 265 | + with pytest.raises(InvalidWheelFilename): |
269 | 266 | Wheel("six-1.16.0_build1-py3-none-any.whl")
|
0 commit comments