From 049ca7e9d2da336e2514eb6e1f765fc4c540d810 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 27 Nov 2014 01:34:48 +0200 Subject: [PATCH] Go back to deleting everything, as it seems to yield the best result --- .../openlp_core_common/test_historycombobox.py | 11 ++++++++--- .../interfaces/openlp_core_lib/test_pluginmanager.py | 2 +- tests/interfaces/openlp_core_lib/test_searchedit.py | 4 ++-- .../openlp_core_ui/test_filerenamedialog.py | 4 ++-- .../openlp_core_ui/test_listpreviewwidget.py | 4 ++-- tests/interfaces/openlp_core_ui/test_mainwindow.py | 2 +- .../openlp_core_ui/test_projectormanager.py | 2 +- .../interfaces/openlp_core_ui/test_servicemanager.py | 4 ++-- .../openlp_core_ui/test_servicenotedialog.py | 4 ++-- tests/interfaces/openlp_core_ui/test_settings_form.py | 2 +- .../openlp_core_ui/test_shortcutlistform.py | 4 ++-- .../interfaces/openlp_core_ui/test_starttimedialog.py | 4 ++-- tests/interfaces/openlp_core_ui/test_thememanager.py | 2 +- .../openlp_plugins/bibles/test_lib_manager.py | 2 +- .../openlp_plugins/bibles/test_lib_parse_reference.py | 2 +- .../openlp_plugins/custom/forms/test_customform.py | 4 ++-- .../custom/forms/test_customslideform.py | 4 ++-- .../media/forms/test_mediaclipselectorform.py | 4 ++-- 18 files changed, 35 insertions(+), 30 deletions(-) diff --git a/tests/interfaces/openlp_core_common/test_historycombobox.py b/tests/interfaces/openlp_core_common/test_historycombobox.py index b2874d07d..3a493b72a 100644 --- a/tests/interfaces/openlp_core_common/test_historycombobox.py +++ b/tests/interfaces/openlp_core_common/test_historycombobox.py @@ -42,6 +42,9 @@ from tests.interfaces import MagicMock, patch class TestHistoryComboBox(TestCase, TestMixin): def setUp(self): + """ + Some pre-test setup required. + """ Registry.create() self.setup_application() self.main_window = QtGui.QMainWindow() @@ -49,9 +52,11 @@ class TestHistoryComboBox(TestCase, TestMixin): self.combo = HistoryComboBox(self.main_window) def tearDown(self): - # del self.combo - # del self.main_window - pass + """ + Delete all the C++ objects at the end so that we don't have a segfault + """ + del self.combo + del self.main_window def get_items_test(self): """ diff --git a/tests/interfaces/openlp_core_lib/test_pluginmanager.py b/tests/interfaces/openlp_core_lib/test_pluginmanager.py index afe3d860e..4c51ea465 100644 --- a/tests/interfaces/openlp_core_lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core_lib/test_pluginmanager.py @@ -63,9 +63,9 @@ class TestPluginManager(TestCase, TestMixin): Registry().register('main_window', self.main_window) def tearDown(self): - # del self.main_window Settings().remove('advanced/data path') self.destroy_settings() + del self.main_window # On windows we need to manually garbage collect to close sqlalchemy files # to avoid errors when temporary files are deleted. gc.collect() diff --git a/tests/interfaces/openlp_core_lib/test_searchedit.py b/tests/interfaces/openlp_core_lib/test_searchedit.py index ce2dd07b5..8095c543f 100644 --- a/tests/interfaces/openlp_core_lib/test_searchedit.py +++ b/tests/interfaces/openlp_core_lib/test_searchedit.py @@ -73,8 +73,8 @@ class TestSearchEdit(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.search_edit - # del self.main_window + del self.search_edit + del self.main_window def set_search_types_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_filerenamedialog.py b/tests/interfaces/openlp_core_ui/test_filerenamedialog.py index 0e0bfead1..611b3453b 100644 --- a/tests/interfaces/openlp_core_ui/test_filerenamedialog.py +++ b/tests/interfaces/openlp_core_ui/test_filerenamedialog.py @@ -55,8 +55,8 @@ class TestStartFileRenameForm(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.form - # del self.main_window + del self.form + del self.main_window def window_title_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py b/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py index 43e1931be..24766f6ef 100644 --- a/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py +++ b/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py @@ -61,8 +61,8 @@ class TestListPreviewWidget(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault. """ - # del self.preview_widget - # del self.main_window + del self.preview_widget + del self.main_window def initial_slide_count_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_mainwindow.py b/tests/interfaces/openlp_core_ui/test_mainwindow.py index b6d1aab31..c5d170fff 100644 --- a/tests/interfaces/openlp_core_ui/test_mainwindow.py +++ b/tests/interfaces/openlp_core_ui/test_mainwindow.py @@ -70,7 +70,7 @@ class TestMainWindow(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.main_window + del self.main_window def restore_current_media_manager_item_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_projectormanager.py b/tests/interfaces/openlp_core_ui/test_projectormanager.py index ea3219e28..1f53195a3 100644 --- a/tests/interfaces/openlp_core_ui/test_projectormanager.py +++ b/tests/interfaces/openlp_core_ui/test_projectormanager.py @@ -70,8 +70,8 @@ class TestProjectorManager(TestCase, TestMixin): Delete all the C++ objects at the end so that we don't have a segfault. """ self.projectordb.session.close() - #del self.projector_manager self.destroy_settings() + del self.projector_manager def bootstrap_initialise_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_servicemanager.py b/tests/interfaces/openlp_core_ui/test_servicemanager.py index 3d8e31ef7..fdd0a31bc 100644 --- a/tests/interfaces/openlp_core_ui/test_servicemanager.py +++ b/tests/interfaces/openlp_core_ui/test_servicemanager.py @@ -57,8 +57,8 @@ class TestServiceManager(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.service_manager - # del self.main_window + del self.service_manager + del self.main_window def basic_service_manager_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_servicenotedialog.py b/tests/interfaces/openlp_core_ui/test_servicenotedialog.py index 98c7bfd71..bd23e79e9 100644 --- a/tests/interfaces/openlp_core_ui/test_servicenotedialog.py +++ b/tests/interfaces/openlp_core_ui/test_servicenotedialog.py @@ -55,8 +55,8 @@ class TestStartNoteDialog(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.form - # del self.main_window + del self.form + del self.main_window def basic_display_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_settings_form.py b/tests/interfaces/openlp_core_ui/test_settings_form.py index c3d5207f9..7c2181b41 100644 --- a/tests/interfaces/openlp_core_ui/test_settings_form.py +++ b/tests/interfaces/openlp_core_ui/test_settings_form.py @@ -71,7 +71,7 @@ class TestSettingsForm(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.form + del self.form def basic_cancel_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_shortcutlistform.py b/tests/interfaces/openlp_core_ui/test_shortcutlistform.py index bed369721..58bd5c015 100644 --- a/tests/interfaces/openlp_core_ui/test_shortcutlistform.py +++ b/tests/interfaces/openlp_core_ui/test_shortcutlistform.py @@ -55,8 +55,8 @@ class TestShortcutform(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.form - # del self.main_window + del self.form + del self.main_window def adjust_button_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_starttimedialog.py b/tests/interfaces/openlp_core_ui/test_starttimedialog.py index 4d4412ae4..b561a1722 100644 --- a/tests/interfaces/openlp_core_ui/test_starttimedialog.py +++ b/tests/interfaces/openlp_core_ui/test_starttimedialog.py @@ -55,8 +55,8 @@ class TestStartTimeDialog(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.form - # del self.main_window + del self.form + del self.main_window def ui_defaults_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_thememanager.py b/tests/interfaces/openlp_core_ui/test_thememanager.py index 517736b26..647574022 100644 --- a/tests/interfaces/openlp_core_ui/test_thememanager.py +++ b/tests/interfaces/openlp_core_ui/test_thememanager.py @@ -54,8 +54,8 @@ class TestThemeManager(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.theme_manager self.destroy_settings() + del self.theme_manager def initialise_test(self): """ diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py b/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py index fc253dfe1..0218cbc17 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py @@ -73,7 +73,7 @@ class TestBibleManager(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.manager + del self.manager self.destroy_settings() def get_books_test(self): diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py index f384b0326..1b8570a38 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py @@ -73,7 +73,7 @@ class TestBibleManager(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.manager + del self.manager self.destroy_settings() def parse_reference_one_test(self): diff --git a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py index f32bf722c..52b0db950 100644 --- a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py +++ b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py @@ -61,8 +61,8 @@ class TestEditCustomForm(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.form - # del self.main_window + del self.form + del self.main_window def load_themes_test(self): """ diff --git a/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py b/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py index e52c0cf86..e961eff03 100644 --- a/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py +++ b/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py @@ -57,8 +57,8 @@ class TestEditCustomSlideForm(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.form - # del self.main_window + del self.form + del self.main_window def basic_test(self): """ diff --git a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py index 79de00350..2674843f5 100644 --- a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py +++ b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py @@ -76,9 +76,9 @@ class TestMediaClipSelectorForm(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ - # del self.form + del self.form self.vlc_patcher.stop() - # del self.main_window + del self.main_window def basic_test(self): """