Skip to content

Commit 0e6a3a3

Browse files
Bordatchatonethanwharris
committed
test for Enable setting property (#15755)
Co-authored-by: thomas chaton <[email protected]> Co-authored-by: Ethan Harris <[email protected]> (cherry picked from commit ba14038)
1 parent 636a46c commit 0e6a3a3

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

tests/tests_app/core/test_lightning_app.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,6 @@ class FlowValue(LightningFlow):
11141114
def __init__(self):
11151115
super().__init__()
11161116
self._value = None
1117-
self._has_found = False
11181117

11191118
@property
11201119
def value(self):
@@ -1125,19 +1124,13 @@ def value(self, value):
11251124
self._value = value
11261125

11271126
def run(self):
1128-
if self.value is None:
1129-
self.value = True
1130-
1131-
def __setattr__(self, name, value):
1132-
if name == "_value" and value is True:
1133-
self._has_found = True
1134-
super().__setattr__(name, value)
1127+
self.value = True
11351128

11361129

11371130
def test_lightning_flow_properties():
11381131
"""Validates setting properties to the LightningFlow properly calls property.fset."""
11391132

11401133
flow = FlowValue()
1141-
assert not flow._has_found
1134+
assert flow._value is None
11421135
flow.run()
1143-
assert flow._has_found
1136+
assert flow._value is True

0 commit comments

Comments
 (0)