chiark / gitweb /
Test math rendering only if LaTeX is installed.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Dec 2017 23:15:23 +0000 (00:15 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Dec 2017 23:16:39 +0000 (00:16 +0100)
Had to do this because it's impossible to set this up on 14.04 on Travis
CI :/

doxygen/test/test_contents.py
pelican-plugins/m/test/test_math.py

index 59247290ae9468698bff290dd2d1930bcc97b271..03347c029f1931def729f0c452cd8fc71d31de57 100644 (file)
@@ -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'))
index 534a3e7d92bc875d95b776837fa6dacb8a223b70..5cedd423fb9ce52a9005f9d044287a5da51ecab5 100644 (file)
@@ -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']