From dc3cd4157622275a242c17799baf2a7ac2a2294b Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 14 Jan 2015 11:57:54 +0100 Subject: [PATCH] Use a in-memory sqlite DB for projector test, instead of filebased. Fixes a filelock issue in windows tests. --- tests/interfaces/openlp_core_ui/test_projectoreditform.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/interfaces/openlp_core_ui/test_projectoreditform.py b/tests/interfaces/openlp_core_ui/test_projectoreditform.py index ae3a53039..f7b882528 100644 --- a/tests/interfaces/openlp_core_ui/test_projectoreditform.py +++ b/tests/interfaces/openlp_core_ui/test_projectoreditform.py @@ -31,8 +31,6 @@ Interface tests to test the openlp.core.ui.projector.editform.ProjectorEditForm( class and methods. """ -import os -import tempfile from unittest import TestCase from openlp.core.common import Registry, Settings @@ -43,8 +41,6 @@ from tests.functional import patch from tests.helpers.testmixin import TestMixin from tests.resources.projector.data import TEST1_DATA, TEST2_DATA -tmpfile = tempfile.mkstemp(prefix='openlp-test-projectormanager', suffix='.sql')[1] - class TestProjectorEditForm(TestCase, TestMixin): """ @@ -60,8 +56,7 @@ class TestProjectorEditForm(TestCase, TestMixin): self.setup_application() Registry.create() with patch('openlp.core.lib.projector.db.init_url') as mocked_init_url: - mocked_init_url.start() - mocked_init_url.return_value = 'sqlite:///{}'.format(tmpfile) + mocked_init_url.return_value = 'sqlite://' self.projectordb = ProjectorDB() self.projector_form = ProjectorEditForm(projectordb=self.projectordb) @@ -74,7 +69,6 @@ class TestProjectorEditForm(TestCase, TestMixin): """ self.projectordb.session.close() del(self.projector_form) - os.remove(tmpfile) self.destroy_settings() def edit_form_add_projector_test(self):