Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions datalab/tests/features/common/processing_preview_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,16 @@ def test_live_image_to_signal_preview(tmp_path, monkeypatch):
assert expected.x.size == 8
dialog = ProcessingPreviewDialog(param, line_profile, [source])
loop = QW.QApplication.instance()

def stop_loop(*_args) -> None:
# Unlike quit(), exit() does not close top-level windows with Qt 6
loop.exit()

timeout = QC.QTimer()
timeout.setSingleShot(True)
timeout.timeout.connect(loop.quit)
dialog.preview.controller.SIG_RESULT.connect(loop.quit)
dialog.preview.controller.SIG_ERROR.connect(loop.quit)
timeout.timeout.connect(stop_loop)
dialog.preview.controller.SIG_RESULT.connect(stop_loop)
dialog.preview.controller.SIG_ERROR.connect(stop_loop)
dialog.show()
executor = None
try:
Expand Down
Loading