diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-08 01:11:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 01:11:17 +0900 |
commit | ca9342cc440bd3842dff26841d146beaf7b8c4b3 (patch) | |
tree | 286bfd6736d7971eaa9a51f7b07cad2dee34417c /tests/test_ext_math.py | |
parent | 2d53b7cd6638a579fea23186762b1a561dadeb14 (diff) | |
parent | af4e615a8a25c15df844cf51a2eb2647111bd472 (diff) | |
download | sphinx-git-ca9342cc440bd3842dff26841d146beaf7b8c4b3.tar.gz |
Merge pull request #8631 from tk0miya/6241_assets_for_specific_page
Close #6241: html: Allow to add JS/CSS files to the specific page
Diffstat (limited to 'tests/test_ext_math.py')
-rw-r--r-- | tests/test_ext_math.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_ext_math.py b/tests/test_ext_math.py index 28c2c35a5..10c8c4866 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): |