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

Method test_success_because_fails

tests/test_validators.py:1166–1178  ·  view source on GitHub ↗

If the wrapped validator fails, we're happy.

(self)

Source from the content-addressed store, hash-verified

1164 ) == repr(v)
1165
1166 def test_success_because_fails(self):
1167 """
1168 If the wrapped validator fails, we're happy.
1169 """
1170
1171 def always_fails(inst, attr, value):
1172 raise ValueError("always fails")
1173
1174 v = not_(always_fails)
1175 a = simple_attr("test")
1176 input_value = 3
1177
1178 v(1, a, input_value)
1179
1180 def test_fails_because_success(self):
1181 """

Callers

nothing calls this directly

Calls 2

not_Function · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected