(self)
| 34 | assert len(accesses) == 2 |
| 35 | |
| 36 | def test_set(self): |
| 37 | class T: |
| 38 | @utils.cached_property |
| 39 | def t(self): |
| 40 | accesses.append(None) |
| 41 | return 14 |
| 42 | |
| 43 | accesses: typing.List[typing.Optional[T]] = [] |
| 44 | t = T() |
| 45 | with pytest.raises(AttributeError): |
| 46 | t.t = None |
| 47 | assert len(accesses) == 0 |
| 48 | assert t.t == 14 |
| 49 | assert len(accesses) == 1 |
| 50 | with pytest.raises(AttributeError): |
| 51 | t.t = None |
| 52 | assert len(accesses) == 1 |
| 53 | assert t.t == 14 |
| 54 | assert len(accesses) == 1 |
| 55 | |
| 56 | |
| 57 | def test_enum(): |