diff --git a/bindings/python/tests-py/test_jsonschema.py b/bindings/python/tests-py/test_jsonschema.py index e88de863..a363ad9d 100644 --- a/bindings/python/tests-py/test_jsonschema.py +++ b/bindings/python/tests-py/test_jsonschema.py @@ -1,3 +1,4 @@ +from collections import namedtuple from contextlib import suppress from functools import partial @@ -87,6 +88,14 @@ def test_array_tuple_invalid(val): validate(schema, val) +def test_named_tuple(): + Person = namedtuple("Person", "first_name last_name") + person_a = Person("Joe", "Smith") + schema = {"type": "array", "items": {"type": "string"}} + with pytest.raises(ValueError): + validate(schema, person_a) + + def test_recursive_dict(): instance = {} instance["foo"] = instance