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

Method test_none_factory

tests/test_converters.py:217–227  ·  view source on GitHub ↗

Factories are used if None is passed.

(self)

Source from the content-addressed store, hash-verified

215 assert 42 == c(None)
216
217 def test_none_factory(self):
218 """
219 Factories are used if None is passed.
220 """
221 c = default_if_none(factory=list)
222
223 assert [] == c(None)
224
225 c = default_if_none(default=Factory(list))
226
227 assert [] == c(None)
228
229
230class TestPipe:

Callers

nothing calls this directly

Calls 2

default_if_noneFunction · 0.90
FactoryClass · 0.90

Tested by

no test coverage detected