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

Method test_fail_invalid_key

tests/test_validators.py:722–731  ·  view source on GitHub ↗

Raise key validator error if an invalid key is found.

(self)

Source from the content-addressed store, hash-verified

720 v(None, a, None)
721
722 def test_fail_invalid_key(self):
723 """
724 Raise key validator error if an invalid key is found.
725 """
726 key_validator = instance_of(str)
727 value_validator = instance_of(int)
728 v = deep_mapping(key_validator, value_validator)
729 a = simple_attr("test")
730 with pytest.raises(TypeError):
731 v(None, a, {"a": 6, 42: 7})
732
733 def test_fail_invalid_member(self):
734 """

Callers

nothing calls this directly

Calls 3

instance_ofFunction · 0.90
deep_mappingFunction · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected