From 2a880b7d9b455fbdd7bf718af3de4a266ece06b0 Mon Sep 17 00:00:00 2001 From: Tiago Montes Date: Wed, 20 Mar 2019 18:42:08 +0000 Subject: [PATCH] Fix intermittently failing macOS test. --- tests/interface/test_editor.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/interface/test_editor.py b/tests/interface/test_editor.py index 8783e3c72..3543a5bbb 100644 --- a/tests/interface/test_editor.py +++ b/tests/interface/test_editor.py @@ -129,7 +129,7 @@ def test_Editor_connect_margin_ignores_margin_4(): ep.connect_margin(mock_fn) margin = 4 line = 0 - modifiers = Qt.KeyboardModifiers() + modifiers = Qt.NoModifier ep.marginClicked.emit(margin, line, modifiers) assert mock_fn.call_count == 0 @@ -143,9 +143,16 @@ def test_Editor_connect_margin_1_works(): ep.connect_margin(mock_fn) margin = 1 line = 0 - modifiers = Qt.KeyboardModifiers() + modifiers = Qt.NoModifier ep.marginClicked.emit(margin, line, modifiers) - mock_fn.assert_called_once_with(margin, line, modifiers) + + mock_fn.assert_called_once() + args, _kwargs = mock_fn.call_args + call_margin, call_line, _call_modifiers = args + assert margin == call_margin + assert line == call_line + # Don't assert _call_modifiers value: not used in implementation and seems + # to fail intermittently on macOS. def test_EditorPane_set_theme():