Return value of converter is used as the attribute's value.
(self)
| 1669 | class="st">""" |
| 1670 | |
| 1671 | def test_converter(self): |
| 1672 | class="st">""" |
| 1673 | Return value of converter is used as the attribute&class="cm">#x27;s value. |
| 1674 | class="st">""" |
| 1675 | C = make_class( |
| 1676 | class="st">"C", {class="st">"x": attr.ib(converter=lambda v: v + 1), class="st">"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 | class="st">""" |
nothing calls this directly
no test coverage detected