If `init` is False, ignore that attribute.
(self, slots, frozen)
| 745 | |
| 746 | @given(booleans(), booleans()) |
| 747 | def test_init(self, slots, frozen): |
| 748 | """ |
| 749 | If `init` is False, ignore that attribute. |
| 750 | """ |
| 751 | C = make_class( |
| 752 | "C", |
| 753 | {"a": attr.ib(init=False), "b": attr.ib()}, |
| 754 | slots=slots, |
| 755 | frozen=frozen, |
| 756 | ) |
| 757 | with pytest.raises(TypeError) as e: |
| 758 | C(a=1, b=2) |
| 759 | |
| 760 | assert e.value.args[0].endswith( |
| 761 | "__init__() got an unexpected keyword argument 'a'" |
| 762 | ) |
| 763 | |
| 764 | @given(booleans(), booleans()) |
| 765 | def test_no_init_default(self, slots, frozen): |
nothing calls this directly
no test coverage detected