@@ -106,22 +106,13 @@ def test_validates_valid_pep440_version(self, version):
106
106
form , field = pretend .stub (), pretend .stub (data = version )
107
107
legacy ._validate_pep440_version (form , field )
108
108
109
- @pytest .mark .parametrize ("version" , ["dog" , "1.0.dev.a1" ])
109
+ @pytest .mark .filterwarnings ("ignore:Creating a LegacyVersion.*:DeprecationWarning" )
110
+ @pytest .mark .parametrize ("version" , ["dog" , "1.0.dev.a1" , "1.0+local" ])
110
111
def test_validates_invalid_pep440_version (self , version ):
111
112
form , field = pretend .stub (), pretend .stub (data = version )
112
- with pytest .raises (ValidationError ) as e :
113
- legacy ._validate_pep440_version (form , field )
114
-
115
- assert str (e .value ) == "Invalid PEP 440 version."
116
-
117
- @pytest .mark .parametrize ("version" , ["1.0+local" ])
118
- def test_validates_local_pep440_version (self , version ):
119
- form , field = pretend .stub (), pretend .stub (data = version )
120
- with pytest .raises (ValidationError ) as e :
113
+ with pytest .raises (ValidationError ):
121
114
legacy ._validate_pep440_version (form , field )
122
115
123
- assert str (e .value ) == "Can't use PEP 440 local versions."
124
-
125
116
@pytest .mark .parametrize (
126
117
("requirement" , "expected" ),
127
118
[("foo" , ("foo" , None )), ("foo (>1.0)" , ("foo" , ">1.0" ))],
@@ -877,9 +868,11 @@ def test_fails_invalid_version(self, pyramid_config, pyramid_request, version):
877
868
(
878
869
{"metadata_version" : "1.2" , "name" : "example" , "version" : "dog" },
879
870
"'dog' is an invalid value for Version. "
880
- "Error: Invalid PEP 440 version. See "
881
- "https://packaging.python.org/specifications/core-metadata for "
882
- "more information." ,
871
+ "Error: Start and end with a letter or numeral "
872
+ "containing only ASCII numeric and '.', '_' and '-'. "
873
+ "See "
874
+ "https://packaging.python.org/specifications/core-metadata"
875
+ " for more information." ,
883
876
),
884
877
# filetype/pyversion errors.
885
878
(
@@ -1001,6 +994,7 @@ def test_fails_invalid_version(self, pyramid_config, pyramid_request, version):
1001
994
),
1002
995
],
1003
996
)
997
+ @pytest .mark .filterwarnings ("ignore:Creating a LegacyVersion.*:DeprecationWarning" )
1004
998
def test_fails_invalid_post_data (
1005
999
self , pyramid_config , db_request , post_data , message
1006
1000
):
0 commit comments