Skip to content

Commit 4a870be

Browse files
author
Doug Borg
committed
tests: tighten 3.1 unsupported feature expectations to ValidationError
1 parent 75d4bf8 commit 4a870be

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/test_openapi_31_coverage.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,10 @@ def test_boolean_schemas_not_supported(self):
361361
},
362362
}
363363

364-
with pytest.raises(Exception): # Should fail to parse
364+
from pydantic import ValidationError
365+
366+
# Boolean schemas (True/False) should raise a pydantic ValidationError
367+
with pytest.raises(ValidationError): # Should fail to parse
365368
parse_openapi_31(spec_with_boolean_schemas)
366369

367370
def test_boolean_items_not_supported(self):
@@ -381,7 +384,10 @@ def test_boolean_items_not_supported(self):
381384
},
382385
}
383386

384-
with pytest.raises(Exception): # Should fail to parse
387+
from pydantic import ValidationError
388+
389+
# items: False should raise a pydantic ValidationError
390+
with pytest.raises(ValidationError): # Should fail to parse
385391
parse_openapi_31(spec_with_boolean_items)
386392

387393

0 commit comments

Comments
 (0)