diff --git a/tests/test_v.py b/tests/test_v.py index 4aa97164..d2ba3f75 100644 --- a/tests/test_v.py +++ b/tests/test_v.py @@ -15,6 +15,7 @@ from cattrs import Converter, transform_error from cattrs._compat import Mapping, TypedDict +from cattrs.errors import IterableValidationError from cattrs.gen import make_dict_structure_fn from cattrs.v import format_exception @@ -22,7 +23,7 @@ @fixture def c() -> Converter: """We need only converters with detailed_validation=True.""" - return Converter() + return Converter(detailed_validation=True) def test_attribute_errors(c: Converter) -> None: @@ -190,6 +191,11 @@ class C: "invalid value for type, expected int @ $.b[1][2]", ] + # IterableValidationErrors with subexceptions without notes + exc = IterableValidationError("Test", [TypeError("Test")], list[str]) + + assert transform_error(exc) == ["invalid type (Test) @ $"] + def test_mapping_errors(c: Converter) -> None: try: