From 0dbac37f97c019fc1abf7a8ec87fe95221cb85fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Dec 2017 00:15:23 +0100 Subject: [PATCH] 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 :/ --- doxygen/test/test_contents.py | 3 +++ pelican-plugins/m/test/test_math.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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'] -- 2.30.2