From 20f01b351cec98e3acafa8e03a63d17ff898acbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 5 Apr 2024 11:06:26 +0200 Subject: [PATCH] SquishTests: Replace wait condition strings with lambdas Squish allows passing wait conditions as strings containing python code. The only advantage I see is that the notation is a little shorter than using a lambda. On the other hand, the strings can't get proper syntax highlighting and cause false positive warnings about unused variables. Change-Id: I226840fa26dc75d07d89f20647d069e2e866bbc9 Reviewed-by: Christian Stenger --- tests/system/suite_general/tst_openqt_creator/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system/suite_general/tst_openqt_creator/test.py b/tests/system/suite_general/tst_openqt_creator/test.py index c0cbc815a22..3c55342fc21 100644 --- a/tests/system/suite_general/tst_openqt_creator/test.py +++ b/tests/system/suite_general/tst_openqt_creator/test.py @@ -21,13 +21,13 @@ def main(): openQmakeProject(os.path.join(pathSpeedcrunch, "src", "speedcrunch.pro"), [Targets.DESKTOP_5_14_1_DEFAULT]) # Wait for parsing to complete - waitFor("runButton.enabled", 30000) + waitFor(lambda: runButton.enabled, 30000) # Starting before opening, because this is where Creator froze (QTCREATORBUG-10733) startopening = datetime.utcnow() openQmakeProject(pathCreator, [Targets.DESKTOP_5_14_1_DEFAULT]) # Wait for parsing to complete startreading = datetime.utcnow() - waitFor("runButton.enabled", 300000) + waitFor(lambda: runButton.enabled, 300000) secondsOpening = (datetime.utcnow() - startopening).seconds secondsReading = (datetime.utcnow() - startreading).seconds timeoutOpen = 45