From 51eefc84d91442a0663db81ea88e368335863384 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 6 Jan 2016 22:00:51 +0200 Subject: [PATCH] Fix OS X test which wasn't being skipped on non-OS X platforms --- tests/functional/openlp_core_ui/test_maindisplay.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/functional/openlp_core_ui/test_maindisplay.py b/tests/functional/openlp_core_ui/test_maindisplay.py index 6e187d44e..1f4649dbc 100644 --- a/tests/functional/openlp_core_ui/test_maindisplay.py +++ b/tests/functional/openlp_core_ui/test_maindisplay.py @@ -22,7 +22,7 @@ """ Package to test the openlp.core.ui.slidecontroller package. """ -from unittest import TestCase +from unittest import TestCase, skipUnless from PyQt5 import QtCore @@ -141,13 +141,14 @@ class TestMainDisplay(TestCase, TestMixin): mocked_songs_plugin.refresh_css.assert_called_with(main_display.frame) mocked_bibles_plugin.refresh_css.assert_called_with(main_display.frame) - @patch('openlp.core.ui.maindisplay.is_macosx') + @skipUnless(is_macosx(), 'Can only run test on Mac OS X due to pyobjc dependency.') def macosx_display_window_flags_state_test(self, is_macosx): """ Test that on Mac OS X we set the proper window flags """ + if not is_macosx(): + self.skipTest('Can only run test on Mac OS X due to pyobjc dependency.') # GIVEN: A new SlideController instance on Mac OS X. - is_macosx.return_value = True self.screens.set_current_display(0) display = MagicMock() @@ -159,12 +160,11 @@ class TestMainDisplay(TestCase, TestMixin): main_display.windowFlags(), 'The window flags should be Qt.Window, and Qt.FramelessWindowHint.') + @skipUnless(is_macosx(), 'Can only run test on Mac OS X due to pyobjc dependency.') def macosx_display_test(self): """ Test display on Mac OS X """ - if not is_macosx(): - self.skipTest('Can only run test on Mac OS X due to pyobjc dependency.') # GIVEN: A new SlideController instance on Mac OS X. self.screens.set_current_display(0) display = MagicMock()