@@ -240,6 +240,30 @@ def test_basic_type_formats(
240240
241241 assert result == unmarshalled
242242
243+ @pytest .mark .parametrize (
244+ "type,format,value" ,
245+ [
246+ ("string" , "float" , "test" ),
247+ ("string" , "double" , "test" ),
248+ ("number" , "date" , 3 ),
249+ ("number" , "date-time" , 3 ),
250+ ("number" , "uuid" , 3 ),
251+ ],
252+ )
253+ def test_basic_type_formats_ignored (
254+ self , unmarshallers_factory , type , format , value
255+ ):
256+ schema = {
257+ "type" : type ,
258+ "format" : format ,
259+ }
260+ spec = Spec .from_dict (schema , validator = None )
261+ unmarshaller = unmarshallers_factory .create (spec )
262+
263+ result = unmarshaller .unmarshal (value )
264+
265+ assert result == value
266+
243267 @pytest .mark .parametrize (
244268 "type,format,value" ,
245269 [
@@ -374,23 +398,17 @@ def test_string_uuid_invalid(self, unmarshallers_factory):
374398 assert len (exc_info .value .schema_errors ) == 1
375399 assert f"is not a 'uuid'" in exc_info .value .schema_errors [0 ].message
376400
377- @pytest .mark .xfail (
378- reason = (
379- "Formats raise error for other types. "
380- "See https://github.com/python-openapi/openapi-schema-validator/issues/66"
381- )
382- )
383401 @pytest .mark .parametrize (
384402 "type,format,value,expected" ,
385403 [
386404 ("string" , "float" , "test" , "test" ),
387405 ("string" , "double" , "test" , "test" ),
388- ("string " , "byte" , "test" , "test" ),
389- ("integer" , "date" , "10" , 10 ),
390- ("integer" , "date-time" , "10" , 10 ),
406+ ("integer " , "byte" , 10 , 10 ),
407+ ("integer" , "date" , 10 , 10 ),
408+ ("integer" , "date-time" , 10 , 10 ),
391409 ("string" , "int32" , "test" , "test" ),
392410 ("string" , "int64" , "test" , "test" ),
393- ("integer" , "password" , "10" , 10 ),
411+ ("integer" , "password" , 10 , 10 ),
394412 ],
395413 )
396414 def test_formats_ignored (
@@ -1728,7 +1746,8 @@ def test_basic_type_oas30_formats_invalid(
17281746 reason = (
17291747 "OAS 3.0 string type checker allows byte. "
17301748 "See https://github.com/python-openapi/openapi-schema-validator/issues/64"
1731- )
1749+ ),
1750+ strict = True ,
17321751 )
17331752 def test_string_format_binary_invalid (self , unmarshallers_factory ):
17341753 schema = {
@@ -1748,7 +1767,8 @@ def test_string_format_binary_invalid(self, unmarshallers_factory):
17481767 reason = (
17491768 "Rraises TypeError not SchemaError. "
17501769 "See ttps://github.com/python-openapi/openapi-schema-validator/issues/65"
1751- )
1770+ ),
1771+ strict = True ,
17521772 )
17531773 @pytest .mark .parametrize (
17541774 "types,value" ,
@@ -1928,7 +1948,8 @@ def unmarshallers_factory(self):
19281948 reason = (
19291949 "OpenAPI 3.1 schema validator uses OpenAPI 3.0 format checker."
19301950 "See https://github.com/python-openapi/openapi-core/issues/506"
1931- )
1951+ ),
1952+ strict = True ,
19321953 )
19331954 @pytest .mark .parametrize (
19341955 "type,format" ,
0 commit comments