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

Method test_factory_takes_self

tests/test_converters.py:189–194  ·  view source on GitHub ↗

Raises ValueError if passed Factory has takes_self=True.

(self)

Source from the content-addressed store, hash-verified

187 default_if_none(True, lambda: 42)
188
189 def test_factory_takes_self(self):
190 """
191 Raises ValueError if passed Factory has takes_self=True.
192 """
193 with pytest.raises(ValueError, match="takes_self"):
194 default_if_none(Factory(list, takes_self=True))
195
196 @pytest.mark.parametrize("val", [1, 0, True, False, "foo", "", object()])
197 def test_not_none(self, val):

Callers

nothing calls this directly

Calls 2

default_if_noneFunction · 0.90
FactoryClass · 0.90

Tested by

no test coverage detected