From 89ce4131e7db74a7bb133d7155dd0914b7718166 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 20 Apr 2016 21:29:04 +0200 Subject: [PATCH] Skip pysword tests is pysword isn't installed. --- tests/functional/openlp_plugins/bibles/test_swordimport.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/functional/openlp_plugins/bibles/test_swordimport.py b/tests/functional/openlp_plugins/bibles/test_swordimport.py index 6399c5404..ae4d9cdf9 100644 --- a/tests/functional/openlp_plugins/bibles/test_swordimport.py +++ b/tests/functional/openlp_plugins/bibles/test_swordimport.py @@ -25,10 +25,13 @@ This module contains tests for the SWORD Bible importer. import os import json -from unittest import TestCase +from unittest import TestCase, SkipTest from tests.functional import MagicMock, patch -from openlp.plugins.bibles.lib.sword import SwordBible +try: + from openlp.plugins.bibles.lib.sword import SwordBible +except ImportError: + raise SkipTest('PySword is not installed, skipping SWORD test.') from openlp.plugins.bibles.lib.db import BibleDB TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__),