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

Method test_noncallable_validators

tests/test_validators.py:528–544  ·  tests/test_validators.py::TestDeepIterable.test_noncallable_validators

Raise `TypeError` if any validators are not callable.

(
        self, member_validator, iterable_validator
    )

Source from the content-addressed store, hash-verified

526 ],
527 )
528 def test_noncallable_validators(
529 self, member_validator, iterable_validator
530 ):
531 class="st">"""
532 Raise `TypeError` if any validators are not callable.
533 class="st">"""
534 with pytest.raises(TypeError) as e:
535 deep_iterable(member_validator, iterable_validator)
536 value = 42
537 message = (
538 fclass="st">"must be callable (got {value} that is a {value.__class__})."
539 )
540
541 assert message in e.value.args[0]
542 assert value == e.value.args[1]
543 assert message in e.value.msg
544 assert value == e.value.value
545
546 def test_fail_invalid_member(self, member_validator):
547 class="st">"""

Callers

nothing calls this directly

Calls 1

deep_iterableFunction · 0.90

Tested by

no test coverage detected