MCPcopy Index your code
hub / github.com/python-attrs/attrs / test_composable_with_in_fail

Method test_composable_with_in_fail

tests/test_validators.py:1215–1235  ·  view source on GitHub ↗

Check something is ``not in`` something else, but it is, so fail.

(self)

Source from the content-addressed store, hash-verified

1213 v(None, a, input_value)
1214
1215 def test_composable_with_in_fail(self):
1216 """
1217 Check something is ``not in`` something else, but it is, so fail.
1218 """
1219 wrapped = in_("abc")
1220 v = not_(wrapped)
1221 a = simple_attr("test")
1222 input_value = "b"
1223
1224 with pytest.raises(ValueError) as e:
1225 v(None, a, input_value)
1226
1227 assert (
1228 (
1229 "not_ validator child '{!r}' did not raise a captured error"
1230 ).format(in_("abc")),
1231 a,
1232 wrapped,
1233 input_value,
1234 self.DEFAULT_EXC_TYPES,
1235 ) == e.value.args
1236
1237 def test_composable_with_matches_re_pass(self):
1238 """

Callers

nothing calls this directly

Calls 3

in_Function · 0.90
not_Function · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected