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

Method test_fail

tests/test_converters.py:156–163  ·  view source on GitHub ↗

Propagates the underlying conversion error when conversion fails.

(self)

Source from the content-addressed store, hash-verified

154 assert c(None) is None
155
156 def test_fail(self):
157 """
158 Propagates the underlying conversion error when conversion fails.
159 """
160 c = optional(int)
161
162 with pytest.raises(ValueError):
163 c("not_an_int")
164
165 def test_converter_instance(self):
166 """

Callers

nothing calls this directly

Calls 1

optionalFunction · 0.90

Tested by

no test coverage detected