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

Method test_fail_with_string

tests/test_validators.py:433–447  ·  view source on GitHub ↗

Raise ValueError if the value is outside our options when the options are specified as a string and the value is not a string.

(self)

Source from the content-addressed store, hash-verified

431 ) == e.value.args
432
433 def test_fail_with_string(self):
434 """
435 Raise ValueError if the value is outside our options when the
436 options are specified as a string and the value is not a string.
437 """
438 v = in_("abc")
439 a = simple_attr("test")
440 with pytest.raises(ValueError) as e:
441 v(None, a, None)
442 assert (
443 "'test' must be in 'abc' (got None)",
444 a,
445 "abc",
446 None,
447 ) == e.value.args
448
449 def test_repr(self):
450 """

Callers

nothing calls this directly

Calls 2

in_Function · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected