Property tests for attributes using converter.
(self, val, init)
| 1722 | |
| 1723 | @given(integers(), booleans()) |
| 1724 | def test_convert_property(self, val, init): |
| 1725 | """ |
| 1726 | Property tests for attributes using converter. |
| 1727 | """ |
| 1728 | C = make_class( |
| 1729 | "C", |
| 1730 | { |
| 1731 | "y": attr.ib(), |
| 1732 | "x": attr.ib( |
| 1733 | init=init, default=val, converter=lambda v: v + 1 |
| 1734 | ), |
| 1735 | }, |
| 1736 | ) |
| 1737 | c = C(2) |
| 1738 | |
| 1739 | assert c.x == val + 1 |
| 1740 | assert c.y == 2 |
| 1741 | |
| 1742 | @given(integers(), booleans()) |
| 1743 | def test_converter_factory_property(self, val, init): |
nothing calls this directly
no test coverage detected