Skip to content

Commit a0adee6

Browse files
committed
replace walrus
1 parent 947d4d0 commit a0adee6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dash/testing/wait.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ def __call__(self, driver):
6363
try:
6464
elem = driver.find_element(By.CSS_SELECTOR, self.selector)
6565
logger.debug("contains text {%s} => expected %s", elem.text, self.text)
66-
if (value := elem.get_attribute("value")) is not None:
67-
return self.text in str(elem.text) or self.text in str(value)
68-
return self.text in str(elem.text)
66+
value = elem.get_attribute("value")
67+
return str(elem.text) in self.text or (
68+
value is not None and str(value) in self.text
69+
)
6970
except WebDriverException:
7071
return False
7172

0 commit comments

Comments
 (0)