summaryrefslogtreecommitdiff
path: root/tests/test_ext_math.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-08 01:23:17 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-08 01:23:17 +0900
commit5460ea103bd91ce910e50e11e05c1e5340c2a9e0 (patch)
tree2009eec87f4ef7442cd29158c000bd12be17b999 /tests/test_ext_math.py
parent5ba5602d7173d0da7adfb4f1e6279ff40c56ef47 (diff)
parentd9569a84a28b4720f9adf69ef9778961585ea19a (diff)
downloadsphinx-git-5460ea103bd91ce910e50e11e05c1e5340c2a9e0.tar.gz
Merge branch '3.x'
Diffstat (limited to 'tests/test_ext_math.py')
-rw-r--r--tests/test_ext_math.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_ext_math.py b/tests/test_ext_math.py
index 790b5a087..bd124c8c6 100644
--- a/tests/test_ext_math.py
+++ b/tests/test_ext_math.py
@@ -15,6 +15,7 @@ import warnings
import pytest
from docutils import nodes
+from sphinx.ext.mathjax import MATHJAX_URL
from sphinx.testing.util import assert_node
@@ -224,6 +225,18 @@ def test_mathjax_config(app, status, warning):
'</script>' in content)
+@pytest.mark.sphinx('html', testroot='ext-math',
+ confoverrides={'extensions': ['sphinx.ext.mathjax']})
+def test_mathjax_is_installed_only_if_document_having_math(app, status, warning):
+ app.builder.build_all()
+
+ content = (app.outdir / 'index.html').read_text()
+ assert MATHJAX_URL in content
+
+ content = (app.outdir / 'nomath.html').read_text()
+ assert MATHJAX_URL not in content
+
+
@pytest.mark.sphinx('html', testroot='basic',
confoverrides={'extensions': ['sphinx.ext.mathjax']})
def test_mathjax_is_not_installed_if_no_equations(app, status, warning):