From bc51c7ca7f1539aa9b3d2e0a290e2d426b95ca57 Mon Sep 17 00:00:00 2001 From: Simon Hanna Date: Fri, 18 Oct 2019 21:14:22 +0200 Subject: [PATCH] Do not test PyMuPDF if it's not installed Fixes #288 --- .../openlp_plugins/presentations/test_pdfcontroller.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py index c9f9e195f..7ad89f133 100644 --- a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py @@ -22,6 +22,7 @@ This module contains tests for the PdfController """ import os +import pytest from pathlib import Path from shutil import rmtree, which from tempfile import mkdtemp @@ -173,7 +174,13 @@ class TestPdfController(TestCase, TestMixin): if exe_path: self.load_pdf(exe_path) self.load_pdf_pictures(exe_path) - # PyMuPDF + + def test_loading_pdf_using_pymupdf(self): + try: + import fitz # noqa: F401 + except ImportError: + pytest.skip('PyMuPDF is not installed') + self.load_pdf(None) self.load_pdf_pictures(None)