MCPcopy
hub / github.com/python-attrs/attrs / test_fail_invalid_iterable

Method test_fail_invalid_iterable

tests/test_validators.py:555–564  ·  tests/test_validators.py::TestDeepIterable.test_fail_invalid_iterable

Raise iterable validator error if an invalid iterable is found.

(self, member_validator)

Source from the content-addressed store, hash-verified

553 v(None, a, [42, class="st">"42"])
554
555 def test_fail_invalid_iterable(self, member_validator):
556 class="st">"""
557 Raise iterable validator error if an invalid iterable is found.
558 class="st">"""
559 member_validator = instance_of(int)
560 iterable_validator = instance_of(tuple)
561 v = deep_iterable(member_validator, iterable_validator)
562 a = simple_attr(class="st">"test")
563 with pytest.raises(TypeError):
564 v(None, a, [42])
565
566 def test_fail_invalid_member_and_iterable(self, member_validator):
567 class="st">"""

Callers

nothing calls this directly

Calls 3

instance_ofFunction · 0.90
deep_iterableFunction · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected