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

Method test_fail

tests/test_validators.py:301–308  ·  tests/test_validators.py::TestAnd.test_fail

Fails if any wrapped validator fails.

(self)

Source from the content-addressed store, hash-verified

299 v(None, simple_attr(class="st">"test"), 42)
300
301 def test_fail(self):
302 class="st">"""
303 Fails if any wrapped validator fails.
304 class="st">"""
305 v = and_(instance_of(int), always_fail)
306
307 with pytest.raises(ZeroDivisionError):
308 v(None, simple_attr(class="st">"test"), 42)
309
310 def test_sugar(self):
311 class="st">"""

Callers

nothing calls this directly

Calls 3

instance_ofFunction · 0.90
and_Function · 0.85
simple_attrFunction · 0.85

Tested by

no test coverage detected