From: Vladimír Vondruš Date: Mon, 11 Dec 2017 23:15:23 +0000 (+0100) Subject: Test math rendering only if LaTeX is installed. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=0dbac37f97c019fc1abf7a8ec87fe95221cb85fd;p=blog.git Test math rendering only if LaTeX is installed. Had to do this because it's impossible to set this up on 14.04 on Travis CI :/ --- diff --git a/doxygen/test/test_contents.py b/doxygen/test/test_contents.py index 59247290..03347c02 100644 --- a/doxygen/test/test_contents.py +++ b/doxygen/test/test_contents.py @@ -23,6 +23,7 @@ # import os +import shutil import unittest from distutils.version import LooseVersion @@ -104,6 +105,8 @@ class Math(IntegrationTestCase): def __init__(self, *args, **kwargs): super().__init__(__file__, 'math', *args, **kwargs) + @unittest.skipUnless(shutil.which('latex'), + "Math rendering requires LaTeX installed") def test(self): self.run_dox2html5(wildcard='indexpage.xml') self.assertEqual(*self.actual_expected_contents('index.html')) diff --git a/pelican-plugins/m/test/test_math.py b/pelican-plugins/m/test/test_math.py index 534a3e7d..5cedd423 100644 --- a/pelican-plugins/m/test/test_math.py +++ b/pelican-plugins/m/test/test_math.py @@ -23,6 +23,7 @@ # import sys +import shutil import unittest from distutils.version import LooseVersion @@ -33,8 +34,8 @@ class Math(PluginTestCase): def __init__(self, *args, **kwargs): super().__init__(__file__, '', *args, **kwargs) - @unittest.skipUnless(LooseVersion(sys.version) >= LooseVersion("3.5"), - "The math plugin requires at least Python 3.5") + @unittest.skipUnless(LooseVersion(sys.version) >= LooseVersion("3.5") and shutil.which('latex'), + "The math plugin requires at least Python 3.5 and LaTeX installed") def test(self): self.run_pelican({ 'PLUGINS': ['m.htmlsanity', 'm.math']