From a7a71eb1393a30469c23a67d8c025023ff5164ca Mon Sep 17 00:00:00 2001 From: timrid <6593626+timrid@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:12:58 +0200 Subject: [PATCH] tests: hopefully fix the flaky ci tests --- tests/wx_integration/test_wx_hover_tooltip.py | 3 ++- tests/wx_integration/wx_test_helpers.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/wx_integration/test_wx_hover_tooltip.py b/tests/wx_integration/test_wx_hover_tooltip.py index dab5aa2..d4b6284 100644 --- a/tests/wx_integration/test_wx_hover_tooltip.py +++ b/tests/wx_integration/test_wx_hover_tooltip.py @@ -185,8 +185,9 @@ def test_switching_to_different_hoverable_content_does_not_flicker_hide_the_old_ # hover is pending, so the still-shown old popup must not flicker-hide # while waiting for the new content's own show delay to elapse. anchor_b = wx.Rect(anchor_a.x, anchor_a.y - 20, 10, 10) - wx_harness.move_mouse_to(anchor_b.GetPosition(), delay_ms=0) + wx_harness.move_mouse_direct(anchor_b.GetPosition()) tooltip.notify_hover("content-b", anchor_b) + wx_harness.wait_ms(_SHOW_DELAY_MS // 2) # Check that the tooltip is still showing the old content popup = tooltip._popup diff --git a/tests/wx_integration/wx_test_helpers.py b/tests/wx_integration/wx_test_helpers.py index 5fe4749..757f273 100644 --- a/tests/wx_integration/wx_test_helpers.py +++ b/tests/wx_integration/wx_test_helpers.py @@ -80,6 +80,12 @@ def move_mouse_to(self, point: wx.Point, delay_ms: int = 150) -> None: sim = self.ui_simulator self._run_steps([lambda: sim.MouseMove(point.x, point.y)], delay_ms) + def move_mouse_direct(self, point: wx.Point) -> None: + """Move the simulated mouse cursor to an absolute screen point + immediately, without any delay or intermediate steps. + """ + self.ui_simulator.MouseMove(point.x, point.y) + def move_mouse_linear( self, point: wx.Point,