From 0e6a3a3c6a37ef88bc2335d2faa28ce6d7f881d9 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Mon, 21 Nov 2022 20:35:45 +0100 Subject: [PATCH] test for Enable setting property (#15755) Co-authored-by: thomas chaton Co-authored-by: Ethan Harris (cherry picked from commit ba140387f928a04a8b0e090824059b52e6df0bc5) --- tests/tests_app/core/test_lightning_app.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/tests_app/core/test_lightning_app.py b/tests/tests_app/core/test_lightning_app.py index 4f2c0d8a50358..64bee758af5d5 100644 --- a/tests/tests_app/core/test_lightning_app.py +++ b/tests/tests_app/core/test_lightning_app.py @@ -1114,7 +1114,6 @@ class FlowValue(LightningFlow): def __init__(self): super().__init__() self._value = None - self._has_found = False @property def value(self): @@ -1125,19 +1124,13 @@ def value(self, value): self._value = value def run(self): - if self.value is None: - self.value = True - - def __setattr__(self, name, value): - if name == "_value" and value is True: - self._has_found = True - super().__setattr__(name, value) + self.value = True def test_lightning_flow_properties(): """Validates setting properties to the LightningFlow properly calls property.fset.""" flow = FlowValue() - assert not flow._has_found + assert flow._value is None flow.run() - assert flow._has_found + assert flow._value is True