Skip to content

Commit 7e42154

Browse files
author
Doug Borg
committed
tests: use direct ValidationError import in model generator edge test
1 parent 4a870be commit 7e42154

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_model_generator_edges.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ def test_type_converter_anyof_single():
108108

109109
def test_type_converter_unknown_list_first_type_fallback():
110110
# Invalid enum value in list should raise ValidationError (spec invalid)
111-
import pydantic
112-
with pytest.raises(pydantic.ValidationError): # type: ignore[attr-defined]
111+
from pydantic import ValidationError
112+
# Mixing unknown string with enum should raise ValidationError during model validation
113+
with pytest.raises(ValidationError):
113114
Schema(type=["mystery", DataType.STRING]) # type: ignore[arg-type]
114115

115116

0 commit comments

Comments
 (0)