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

Method test_check_invalid

tests/test_validators.py:1008–1018  ·  view source on GitHub ↗

Raise ValueError if len(value) > max_len.

(self, value)

Source from the content-addressed store, hash-verified

1006 ],
1007 )
1008 def test_check_invalid(self, value):
1009 """
1010 Raise ValueError if len(value) > max_len.
1011 """
1012
1013 @attr.s
1014 class Tester:
1015 value = attr.ib(validator=max_len(self.MAX_LENGTH))
1016
1017 with pytest.raises(ValueError):
1018 Tester(value)
1019
1020 def test_repr(self):
1021 """

Callers

nothing calls this directly

Calls 1

TesterClass · 0.70

Tested by

no test coverage detected