Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

Commit de1b031

Browse files
committed
Ensure icon size is always mocked in the expected manner.
1 parent ff5f519 commit de1b031

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/interface/test_main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ def test_FileTabs_addTab():
254254
qtw.removeTab = mock.MagicMock()
255255
qtw.tabBar = mock.MagicMock(return_value=mock_tabbar)
256256
qtw.widget = mock.MagicMock(return_value=None)
257+
iconSize = QSize(12, 12)
258+
qtw.iconSize = mock.MagicMock(return_value=iconSize)
257259
mock_window = mock.MagicMock()
258260
qtw.nativeParentWidget = mock.MagicMock(return_value=mock_window)
259261
ep = mu.interface.editor.EditorPane("/foo/bar.py", "baz")
@@ -301,7 +303,7 @@ def test_FileTabs_addTab():
301303
mock_layout.setSpacing.assert_called_once_with(6)
302304
# Check the icons were loaded
303305
mock_load_icon.assert_called_once_with("close-tab")
304-
mock_load_pixmap.assert_called_once_with("document", size=QSize(12, 12))
306+
mock_load_pixmap.assert_called_once_with("document", size=iconSize)
305307
# We assume the tab id is 0 based on looking at Qt's source
306308
# and the fact the bar was previously empty
307309
right = mu.interface.main.QTabBar.RightSide

0 commit comments

Comments
 (0)