From b3669c4f5dd49c7b5ee2fc3033aedd7908854156 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 30 Nov 2017 15:46:03 -0700 Subject: [PATCH] Change things around a bit --- .../openlp_plugins/songs/test_openoffice.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/functional/openlp_plugins/songs/test_openoffice.py b/tests/functional/openlp_plugins/songs/test_openoffice.py index e122da806..45ef2acfd 100644 --- a/tests/functional/openlp_plugins/songs/test_openoffice.py +++ b/tests/functional/openlp_plugins/songs/test_openoffice.py @@ -22,20 +22,20 @@ """ This module contains tests for the OpenOffice/LibreOffice importer. """ -from unittest import TestCase, SkipTest +from unittest import TestCase, skipIf from unittest.mock import MagicMock, patch -from openlp.core.common import is_linux - -if not is_linux(): - raise SkipTest('Could not import OpenOfficeImport probably due to unavailability of uno') - from openlp.core.common.registry import Registry -from openlp.plugins.songs.lib.importers.openoffice import OpenOfficeImport from tests.helpers.testmixin import TestMixin +try: + from openlp.plugins.songs.lib.importers.openoffice import OpenOfficeImport +except ImportError: + OpenOfficeImport = None + +@skipIf(OpenOfficeImport is None, 'Could not import OpenOfficeImport probably due to unavailability of uno') class TestOpenOfficeImport(TestCase, TestMixin): """ Test the :class:`~openlp.plugins.songs.lib.importer.openoffice.OpenOfficeImport` class