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

Method test_sugar

tests/test_converters.py:257–268  ·  view source on GitHub ↗

`pipe(c1, c2, c3)` and `[c1, c2, c3]` are equivalent.

(self)

Source from the content-addressed store, hash-verified

255 c("33")
256
257 def test_sugar(self):
258 """
259 `pipe(c1, c2, c3)` and `[c1, c2, c3]` are equivalent.
260 """
261
262 @attr.s
263 class C:
264 a1 = attrib(default="True", converter=pipe(str, to_bool, bool))
265 a2 = attrib(default=True, converter=[str, to_bool, bool])
266
267 c = C()
268 assert True is c.a1 is c.a2
269
270 def test_empty(self):
271 """

Callers

nothing calls this directly

Calls 1

CClass · 0.70

Tested by

no test coverage detected