Merge branch 'skip-pymupdf-tests-if-not-installed' into 'master'

Do not test PyMuPDF if it's not installed

Closes #288

See merge request openlp/openlp!48
This commit is contained in:
Raoul Snyman 2019-10-24 20:29:35 +00:00
commit 2ace207485

View File

@ -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)