Skip to content

Commit 04e1648

Browse files
committed
ensure the UI operation finished
1 parent 27a2fb1 commit 04e1648

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/_test_msui/test_msui.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,15 @@ def test_multiple_times_save_filename(qtbot, tmp_path):
7575
assert os.path.exists(filename) is False
7676
# verify that we can save the file multiple times
7777
msui.save_flight_track(filename)
78-
assert os.path.exists(filename)
78+
def assert_wait_until_saved():
79+
assert os.path.exists(filename)
80+
qtbot.wait_until(assert_wait_until_saved)
7981
first_timestamp = os.path.getmtime(filename)
82+
# file update
8083
msui.save_handler()
84+
def assert_wait_until_updated():
85+
assert os.path.exists(filename) and os.path.getmtime(filename) > first_timestamp
86+
qtbot.wait_until(assert_wait_until_updated)
8187
second_timestamp = os.path.getmtime(filename)
8288
with mock.patch("PyQt5.QtWidgets.QMessageBox.warning", return_value=QtWidgets.QMessageBox.Yes):
8389
msui.close()

0 commit comments

Comments
 (0)