Return value of converter is used as the attribute's value.
(self)
| 1669 | """ |
| 1670 | |
| 1671 | def test_converter(self): |
| 1672 | """ |
| 1673 | Return value of converter is used as the attribute's value. |
| 1674 | """ |
| 1675 | C = make_class( |
| 1676 | "C", {"x": attr.ib(converter=lambda v: v + 1), "y": attr.ib()} |
| 1677 | ) |
| 1678 | c = C(1, 2) |
| 1679 | |
| 1680 | assert c.x == 2 |
| 1681 | assert c.y == 2 |
| 1682 | |
| 1683 | def test_converter_wrapped_takes_self(self): |
| 1684 | """ |
nothing calls this directly
no test coverage detected