Add app to test

This commit is contained in:
Tim Bentley 2014-01-04 08:28:45 +00:00
parent 06e68627d7
commit 4c7fa599c6

View File

@ -33,6 +33,8 @@ import os
from unittest import TestCase from unittest import TestCase
from tempfile import mkstemp from tempfile import mkstemp
from PyQt4 import QtGui
from openlp.core.common import Registry, Settings from openlp.core.common import Registry, Settings
from openlp.core.ui import ThemeManager from openlp.core.ui import ThemeManager
from tests.functional import patch, MagicMock from tests.functional import patch, MagicMock
@ -48,16 +50,17 @@ class TestThemeManager(TestCase):
""" """
fd, self.ini_file = mkstemp('.ini') fd, self.ini_file = mkstemp('.ini')
Settings().set_filename(self.ini_file) Settings().set_filename(self.ini_file)
self.app = QtGui.QApplication([])
Registry.create() Registry.create()
self.theme_manager = ThemeManager() self.theme_manager = ThemeManager()
def tearDown(self): def tearDown(self):
""" """
Delete all the C++ objects at the end so that we don't have a segfault Delete all the C++ objects at the end so that we don't have a segfault
""" """
os.unlink(self.ini_file) os.unlink(self.ini_file)
os.unlink(Settings().fileName()) os.unlink(Settings().fileName())
del self.app
def initialise_test(self): def initialise_test(self):
""" """