Skip to content

Commit 8fb7e2a

Browse files
committed
slight shape tools update
1 parent 03c7a11 commit 8fb7e2a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

plotpy/tests/unit/test_shape_tools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import qtpy.QtCore as QC
88
from guidata.qthelpers import exec_dialog, qt_app_context
99

10-
from plotpy.interfaces.items import IBasePlotItem, IShapeItemType
10+
from plotpy.interfaces.items import IShapeItemType
1111
from plotpy.tests import vistools as ptv
1212
from plotpy.tests.features.test_auto_curve_image import make_curve_image_legend
1313
from 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

Comments
 (0)