77import qtpy .QtCore as QC
88from guidata .qthelpers import exec_dialog , qt_app_context
99
10- from plotpy .interfaces .items import IBasePlotItem , IShapeItemType
10+ from plotpy .interfaces .items import IShapeItemType
1111from plotpy .tests import vistools as ptv
1212from plotpy .tests .features .test_auto_curve_image import make_curve_image_legend
1313from plotpy .tools import (
@@ -89,6 +89,7 @@ def _test_annotation_tools(tool_classes: tuple[type[RectangularActionTool], ...]
8989 that the tool is activated and deactivated correctly."""
9090 with qt_app_context (exec_loop = False ) as qapp :
9191 win = create_window (tool_classes )
92+ win .show ()
9293 plot = win .manager .get_plot ()
9394 default_tool = win .manager .get_default_tool ()
9495 for tool_class in tool_classes :
@@ -98,7 +99,7 @@ def _test_annotation_tools(tool_classes: tuple[type[RectangularActionTool], ...]
9899 x_path = np .linspace (0 , 0.5 , 100 )
99100 y_path = np .linspace (0 , 0.5 , 100 )
100101 drag_mouse (win , qapp , x_path , y_path )
101- if getattr (tool_class , "SWITCH_TO_DEFAULT_TOOL" , False ):
102+ if hasattr (tool_class , "SWITCH_TO_DEFAULT_TOOL" ):
102103 assert win .manager .get_default_tool () == default_tool
103104 plot .select_some_items (plot .get_items (item_type = IShapeItemType ))
104105 select_tool = win .manager .get_tool (SelectTool )
0 commit comments