Fix some tests on windows.

This commit is contained in:
Tomas Groth 2016-01-08 22:44:22 +01:00
parent 43e273c4ed
commit a44d70cb0f
2 changed files with 7 additions and 3 deletions

View File

@ -159,7 +159,7 @@ class ThemeForm(QtWidgets.QWizard, Ui_ThemeWizard, RegistryProperties):
if not event:
event = QtGui.QResizeEvent(self.size(), self.size())
QtWidgets.QWizard.resizeEvent(self, event)
if self.currentPage() == self.preview_page:
if hasattr(self, 'preview_page') and self.currentPage() == self.preview_page:
frame_width = self.preview_box_label.lineWidth()
pixmap_width = self.preview_area.width() - 2 * frame_width
pixmap_height = self.preview_area.height() - 2 * frame_width

View File

@ -48,13 +48,17 @@ class TestMixin(object):
"""
Build the settings Object and initialise it
"""
Settings.setDefaultFormat(Settings.IniFormat)
self.fd, self.ini_file = mkstemp('.ini')
Settings().set_filename(self.ini_file)
Settings.set_filename(self.ini_file)
Settings().setDefaultFormat(Settings.IniFormat)
# Needed on windows to make sure a Settings object is available during the tests
self.setting = Settings()
Settings().setValue('themes/global theme', 'my_theme')
def destroy_settings(self):
"""
Destroy the Settings Object
"""
del self.setting
os.close(self.fd)
os.unlink(Settings().fileName())