@@ -268,7 +268,8 @@ def test_basic_type_formats_invalid(
268
268
@pytest .mark .parametrize (
269
269
"value,expected" ,
270
270
[
271
- ("dGVzdA==" , "test" ),
271
+ ("dGVzdA==" , b"test" ),
272
+ ("test" , b"\xb5 \xeb -" ),
272
273
],
273
274
)
274
275
def test_string_byte (self , unmarshallers_factory , value , expected ):
@@ -374,23 +375,17 @@ def test_string_uuid_invalid(self, unmarshallers_factory):
374
375
assert len (exc_info .value .schema_errors ) == 1
375
376
assert f"is not a 'uuid'" in exc_info .value .schema_errors [0 ].message
376
377
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
- )
383
378
@pytest .mark .parametrize (
384
379
"type,format,value,expected" ,
385
380
[
386
381
("string" , "float" , "test" , "test" ),
387
382
("string" , "double" , "test" , "test" ),
388
- ("string " , "byte" , "test" , "test" ),
389
- ("integer" , "date" , "10" , 10 ),
390
- ("integer" , "date-time" , "10" , 10 ),
383
+ ("integer " , "byte" , 10 , 10 ),
384
+ ("integer" , "date" , 10 , 10 ),
385
+ ("integer" , "date-time" , 10 , 10 ),
391
386
("string" , "int32" , "test" , "test" ),
392
387
("string" , "int64" , "test" , "test" ),
393
- ("integer" , "password" , "10" , 10 ),
388
+ ("integer" , "password" , 10 , 10 ),
394
389
],
395
390
)
396
391
def test_formats_ignored (
@@ -1679,7 +1674,7 @@ def test_not_nullable(self, unmarshallers_factory, type):
1679
1674
@pytest .mark .parametrize (
1680
1675
"type,format,value,unmarshalled" ,
1681
1676
[
1682
- ("string" , "byte" , "dGVzdA==" , "test" ),
1677
+ ("string" , "byte" , "dGVzdA==" , b "test" ),
1683
1678
("string" , "binary" , b"test" , b"test" ),
1684
1679
],
1685
1680
)
@@ -1728,7 +1723,8 @@ def test_basic_type_oas30_formats_invalid(
1728
1723
reason = (
1729
1724
"OAS 3.0 string type checker allows byte. "
1730
1725
"See https://github.com/python-openapi/openapi-schema-validator/issues/64"
1731
- )
1726
+ ),
1727
+ strict = True ,
1732
1728
)
1733
1729
def test_string_format_binary_invalid (self , unmarshallers_factory ):
1734
1730
schema = {
@@ -1748,7 +1744,8 @@ def test_string_format_binary_invalid(self, unmarshallers_factory):
1748
1744
reason = (
1749
1745
"Rraises TypeError not SchemaError. "
1750
1746
"See ttps://github.com/python-openapi/openapi-schema-validator/issues/65"
1751
- )
1747
+ ),
1748
+ strict = True ,
1752
1749
)
1753
1750
@pytest .mark .parametrize (
1754
1751
"types,value" ,
@@ -1928,7 +1925,8 @@ def unmarshallers_factory(self):
1928
1925
reason = (
1929
1926
"OpenAPI 3.1 schema validator uses OpenAPI 3.0 format checker."
1930
1927
"See https://github.com/python-openapi/openapi-core/issues/506"
1931
- )
1928
+ ),
1929
+ strict = True ,
1932
1930
)
1933
1931
@pytest .mark .parametrize (
1934
1932
"type,format" ,
0 commit comments