Skip to content

Commit 1836d0d

Browse files
committed
FIX: mouse tests on linux
1 parent 332e4ee commit 1836d0d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_frontend_tkinter_base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ def test_on_leave(self) -> None:
295295

296296
def test_mouse_wheel_scroll_windows(self) -> None:
297297
"""Test mouse wheel scrolling on Windows."""
298+
if platform_system() != "Windows":
299+
pytest.skip("Test only applicable on Windows")
298300
with patch("platform.system", return_value="Windows"):
299301
event = MagicMock()
300302
event.delta = 120
@@ -304,6 +306,8 @@ def test_mouse_wheel_scroll_windows(self) -> None:
304306

305307
def test_mouse_wheel_scroll_linux(self) -> None:
306308
"""Test mouse wheel scrolling on Linux."""
309+
if platform_system() != "Linux":
310+
pytest.skip("Test only applicable on Linux")
307311
with patch("platform.system", return_value="Linux"):
308312
event = MagicMock()
309313
event.num = 4 # Scroll up
@@ -313,7 +317,7 @@ def test_mouse_wheel_scroll_linux(self) -> None:
313317

314318
with patch.object(self.scroll_frame.canvas, "yview_scroll") as mock_yview_scroll:
315319
self.scroll_frame.on_mouse_wheel(event)
316-
mock_yview_scroll.assert_called_once_with(1, "units") # Linux scroll direction is inverted
320+
mock_yview_scroll.assert_called_once_with(-1, "units") # Linux scroll direction is inverted
317321

318322

319323
class TestProgressWindow(unittest.TestCase):

0 commit comments

Comments
 (0)