summaryrefslogtreecommitdiff
path: root/tests/test_ext_math.py
diff options
context:
space:
mode:
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):