From 1e08a6a2024132cd02056f23e7552f186da3f2eb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 17 Aug 2015 23:37:55 +0200 Subject: [PATCH] Fix message box tests on OS X. From the QMessageBox::setWindowTitle docs: On Mac OS X, the window title is ignored (as required by the Mac OS X Guidelines). --- tests/misc/test_msgbox.py | 8 ++++++-- tests/utils/test_error.py | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/misc/test_msgbox.py b/tests/misc/test_msgbox.py index 4f6129f95..108f6d38c 100644 --- a/tests/misc/test_msgbox.py +++ b/tests/misc/test_msgbox.py @@ -18,6 +18,8 @@ """Tests for qutebrowser.misc.msgbox.""" +import sys + import pytest from qutebrowser.misc import msgbox @@ -38,7 +40,8 @@ def test_attributes(qtbot): box = msgbox.msgbox(parent=parent, title=title, text=text, icon=icon, buttons=buttons) qtbot.add_widget(box) - assert box.windowTitle() == title + if sys.platform != 'darwin': + assert box.windowTitle() == title assert box.icon() == icon assert box.standardButtons() == buttons assert box.text() == text @@ -80,6 +83,7 @@ def test_finished_signal(qtbot): def test_information(qtbot): box = msgbox.information(parent=None, title='foo', text='bar') qtbot.add_widget(box) - assert box.windowTitle() == 'foo' + if sys.platform != 'darwin': + assert box.windowTitle() == 'foo' assert box.text() == 'bar' assert box.icon() == QMessageBox.Information diff --git a/tests/utils/test_error.py b/tests/utils/test_error.py index 50ae31a92..61c6b9081 100644 --- a/tests/utils/test_error.py +++ b/tests/utils/test_error.py @@ -18,6 +18,7 @@ """Tests for qutebrowser.utils.error.""" +import sys import collections import logging @@ -60,7 +61,8 @@ def test_err_windows(qtbot, qapp, pre_text, post_text, expected): w = qapp.activeModalWidget() try: qtbot.add_widget(w) - assert w.windowTitle() == 'title' + if sys.platform != 'darwin': + assert w.windowTitle() == 'title' assert w.icon() == QMessageBox.Critical assert w.standardButtons() == QMessageBox.Ok assert w.text() == expected