Skip to content

Commit

Permalink
Allow for edge case of app startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Jul 1, 2024
1 parent 8029c3d commit 903f87a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions testbed/tests/testbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@

def run_tests(app, cov, args, report_coverage, run_slow, running_in_ci):
try:
# Wait for the app's main window to be visible.
# Wait for the app's main window to be visible. Retrieving the actual main window
# will raise an exception until the app is actually initialized, so we check the
# underlying variable.
print("Waiting for app to be ready for testing... ", end="", flush=True)
while app.main_window is None or not app.main_window.visible:
while app._main_window is None:
time.sleep(0.05)
while not app.main_window.visible:
time.sleep(0.05)
print("ready.")
# Control the run speed of the test app.
Expand Down

0 comments on commit 903f87a

Please sign in to comment.