| 35 | |
| 36 | |
| 37 | class MyExprCachedProperty(Expr): |
| 38 | called_cached_property = False |
| 39 | _parameters = ["foo", "bar"] |
| 40 | |
| 41 | @property |
| 42 | def baz(self): |
| 43 | return self.foo + self.bar |
| 44 | |
| 45 | @functools.cached_property |
| 46 | def cached_property(self): |
| 47 | if MyExprCachedProperty.called_cached_property: |
| 48 | raise RuntimeError("No!") |
| 49 | MyExprCachedProperty.called_cached_property = True |
| 50 | return self.foo + self.bar |
| 51 | |
| 52 | |
| 53 | @pytest.mark.slow() |