From 76b47019b6251f6343f7b0a12d8a05b9af8baddc Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 16 Jan 2015 14:51:38 +0100 Subject: [PATCH] Mock out AudioPlayer to avoid loading Phonon during test. --- tests/functional/openlp_core_ui/test_maindisplay.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/functional/openlp_core_ui/test_maindisplay.py b/tests/functional/openlp_core_ui/test_maindisplay.py index 507b89f67..4a7328c45 100644 --- a/tests/functional/openlp_core_ui/test_maindisplay.py +++ b/tests/functional/openlp_core_ui/test_maindisplay.py @@ -39,7 +39,7 @@ from openlp.core.ui import MainDisplay from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET from tests.helpers.testmixin import TestMixin -from tests.functional import MagicMock +from tests.functional import MagicMock, patch SCREEN = { 'primary': False, @@ -64,11 +64,14 @@ class TestMainDisplay(TestCase, TestMixin): self.registry = Registry() self.setup_application() Registry().register('application', self.app) + self.mocked_audio_player = patch('openlp.core.ui.maindisplay.AudioPlayer') + self.mocked_audio_player.start() def tearDown(self): """ Delete QApplication. """ + self.mocked_audio_player.stop() del self.screens def initial_main_display_test(self):