evolve() acts as `__init__` with regards to private attributes.
(self)
| 738 | assert m.startswith("'a' must be <class 'int'>") |
| 739 | |
| 740 | def test_private(self): |
| 741 | """ |
| 742 | evolve() acts as `__init__` with regards to private attributes. |
| 743 | """ |
| 744 | |
| 745 | @attr.s |
| 746 | class C: |
| 747 | _a = attr.ib() |
| 748 | |
| 749 | assert evolve(C(1), a=2)._a == 2 |
| 750 | |
| 751 | with pytest.raises(TypeError): |
| 752 | evolve(C(1), _a=2) |
| 753 | |
| 754 | with pytest.raises(TypeError): |
| 755 | evolve(C(1), a=3, _a=2) |
| 756 | |
| 757 | def test_non_init_attrs(self): |
| 758 | """ |