Skip to content

Commit

Permalink
test: resolve test warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnhan committed Dec 14, 2024
1 parent 2b960f1 commit d67a663
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/interactive/test_imagetool_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def _go_to_file(dialog: QtWidgets.QFileDialog):
accept_dialog(manager.remove_action.trigger)
qtbot.waitUntil(lambda: manager.ntools == 0, timeout=2000)
manager.close()
tmp_dir.cleanup()


def test_can_drop_mime_data(qtbot) -> None:
Expand Down
7 changes: 5 additions & 2 deletions tests/interactive/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from erlab.interactive.curvefittingtool import edctool, mdctool
from erlab.interactive.derivative import dtool
from erlab.interactive.fermiedge import goldtool
from erlab.interactive.imagetool.manager import ImageToolManager
from erlab.interactive.kspace import ktool


Expand Down Expand Up @@ -140,7 +139,8 @@ def test_ktool(qtbot, anglemap, constant_energy) -> None:
win._itool.close()

# Start manager
manager = ImageToolManager()
erlab.interactive.imagetool.manager.main(execute=False)
manager = erlab.interactive.imagetool.manager._manager_instance
qtbot.addWidget(manager)

# Show in manager
Expand All @@ -155,6 +155,9 @@ def test_ktool(qtbot, anglemap, constant_energy) -> None:
manager.remove_tool(0)
assert manager.ntools == 0
manager.close()
erlab.interactive.imagetool.manager._manager_instance = None
erlab.interactive.imagetool.manager._always_use_socket = False

win.close()


Expand Down

0 comments on commit d67a663

Please sign in to comment.