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

Method test_fail_with_string

tests/test_validators.py:433–447  ·  tests/test_validators.py::TestIn_.test_fail_with_string

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 class="st">"""
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 class="st">"""
438 v = in_(class="st">"abc")
439 a = simple_attr(class="st">"test")
440 with pytest.raises(ValueError) as e:
441 v(None, a, None)
442 assert (
443 class="st">"&class="cm">#x27;test' must be in 'abc' (got None)",
444 a,
445 class="st">"abc",
446 None,
447 ) == e.value.args
448
449 def test_repr(self):
450 class="st">"""

Callers

nothing calls this directly

Calls 2

in_Function · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected