Skip to content

Commit 1987d2c

Browse files
committed
Tour feature: fix unattended unit test
1 parent 171e6c0 commit 1987d2c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cdl/core/gui/tour.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
import numpy as np
5656
from guidata.configtools import get_icon, get_image_file_path
5757
from guidata.env import execenv
58-
from guidata.qthelpers import exec_dialog, is_dark_mode
58+
from guidata.qthelpers import is_dark_mode
5959
from qtpy import QtCore as QC
6060
from qtpy import QtGui as QG
6161
from qtpy import QtWidgets as QW
@@ -401,9 +401,14 @@ def show(self) -> StepResult:
401401
self.setup_callback(self.tour.win)
402402
self.update_cover(self.tour.cover)
403403
dialog = StepDialog(self.tour.win, self)
404-
exec_dialog(dialog)
405-
if execenv.unattended and self.step_type != "conclusion":
404+
if not execenv.unattended:
405+
dialog.exec()
406+
elif self.step_type != "conclusion":
406407
dialog.result = StepResult.NEXT
408+
dialog.accept()
409+
else:
410+
dialog.result = StepResult.CLOSE
411+
dialog.reject()
407412
if self.teardown_callback is not None:
408413
self.teardown_callback(self.tour.win)
409414
return dialog.result

0 commit comments

Comments
 (0)