diff --git a/tests/functional/openlp_core_lib/test_registry.py b/tests/functional/openlp_core_lib/test_registry.py index 826aafc9b..a2fe60627 100644 --- a/tests/functional/openlp_core_lib/test_registry.py +++ b/tests/functional/openlp_core_lib/test_registry.py @@ -16,7 +16,7 @@ class TestRegistry(TestCase): Test the registry creation and its usage """ # GIVEN: A new registry - registry = Registry.create() + Registry.create() # WHEN: I add a component it should save it mock_1 = MagicMock() diff --git a/tests/interfaces/openlp_core_ui/test_servicenotedialog.py b/tests/interfaces/openlp_core_ui/test_servicenotedialog.py index e444ff687..f3694fdea 100644 --- a/tests/interfaces/openlp_core_ui/test_servicenotedialog.py +++ b/tests/interfaces/openlp_core_ui/test_servicenotedialog.py @@ -14,7 +14,7 @@ class TestStartNoteDialog(TestCase): """ Create the UI """ - registry = Registry.create() + Registry.create() self.app = QtGui.QApplication([]) self.main_window = QtGui.QMainWindow() Registry().register(u'main_window', self.main_window) @@ -36,7 +36,7 @@ class TestStartNoteDialog(TestCase): self.form.text_edit.setPlainText(u'') # WHEN displaying the UI and pressing enter - with patch(u'PyQt4.QtGui.QDialog') as mocked_exec: + with patch(u'PyQt4.QtGui.QDialog.exec_'): self.form.exec_() okWidget = self.form.button_box.button(self.form.button_box.Save) QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton) @@ -47,7 +47,7 @@ class TestStartNoteDialog(TestCase): # WHEN displaying the UI, having set the text and pressing enter text = u'OpenLP is the best worship software' self.form.text_edit.setPlainText(text) - with patch(u'PyQt4.QtGui.QDialog') as mocked_exec: + with patch(u'PyQt4.QtGui.QDialog.exec_'): self.form.exec_() okWidget = self.form.button_box.button(self.form.button_box.Save) QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton) @@ -57,7 +57,7 @@ class TestStartNoteDialog(TestCase): # WHEN displaying the UI, having set the text and pressing enter self.form.text_edit.setPlainText(u'') - with patch(u'PyQt4.QtGui.QDialog') as mocked_exec: + with patch(u'PyQt4.QtGui.QDialog.exec_'): self.form.exec_() self.form.text_edit.setPlainText(text) okWidget = self.form.button_box.button(self.form.button_box.Save) diff --git a/tests/interfaces/openlp_core_ui/test_starttimedialog.py b/tests/interfaces/openlp_core_ui/test_starttimedialog.py index 990f753ba..a9b33a30c 100644 --- a/tests/interfaces/openlp_core_ui/test_starttimedialog.py +++ b/tests/interfaces/openlp_core_ui/test_starttimedialog.py @@ -14,7 +14,7 @@ class TestStartTimeDialog(TestCase): """ Create the UI """ - registry = Registry.create() + Registry.create() self.app = QtGui.QApplication([]) self.main_window = QtGui.QMainWindow() Registry().register(u'main_window', self.main_window) @@ -67,7 +67,7 @@ class TestStartTimeDialog(TestCase): # WHEN displaying the UI and pressing enter self.form.item = {u'service_item': mocked_serviceitem} - with patch(u'PyQt4.QtGui.QDialog') as mocked_exec: + with patch(u'PyQt4.QtGui.QDialog.exec_'): self.form.exec_() okWidget = self.form.button_box.button(self.form.button_box.Ok) QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton) @@ -80,7 +80,7 @@ class TestStartTimeDialog(TestCase): # WHEN displaying the UI, changing the time to 2min 3secs and pressing enter self.form.item = {u'service_item': mocked_serviceitem} - with patch(u'PyQt4.QtGui.QDialog') as mocked_exec: + with patch(u'PyQt4.QtGui.QDialog.exec_'): self.form.exec_() self.form.minuteSpinBox.setValue(2) self.form.secondSpinBox.setValue(3)