diff --git a/tests/roots/test-ext-math/math.rst b/tests/roots/test-ext-math/math.rst
new file mode 100644
index 000000000..5a209bed4
--- /dev/null
+++ b/tests/roots/test-ext-math/math.rst
@@ -0,0 +1,31 @@
+Test math extensions :math:`E = m c^2`
+======================================
+
+This is inline math: :math:`a^2 + b^2 = c^2`.
+
+.. math:: a^2 + b^2 = c^2
+
+.. math::
+
+ a + 1 < b
+
+.. math::
+ :label: foo
+
+ e^{i\pi} = 1
+
+.. math::
+ :label:
+
+ e^{ix} = \cos x + i\sin x
+
+.. math::
+
+ n \in \mathbb N
+
+.. math::
+ :nowrap:
+
+ a + 1 < b
+
+Referencing equation :eq:`foo`.
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index 7abefbcdc..a127b96e0 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -989,21 +989,6 @@ def test_enumerable_node(app, status, warning):
yield check_xpath, etree, fname, xpath, check, be_found
-@with_app(buildername='html')
-def test_jsmath(app, status, warning):
- app.builder.build_all()
- content = (app.outdir / 'math.html').text()
-
- assert '
\na^2 + b^2 = c^2
' in content
- assert '\n\\begin{split}a + 1 < b\\end{split}
' in content
- assert ('(1)\n'
- 'e^{i\\pi} = 1
' in content)
- assert ('(2)\n'
- 'e^{ix} = \\cos x + i\\sin x
' in content)
- assert '\nn \\in \\mathbb N
' in content
- assert '\na + 1 < b
' in content
-
-
@with_app(buildername='html', testroot='html_extra_path')
def test_html_extra_path(app, status, warning):
app.builder.build_all()
diff --git a/tests/test_ext_math.py b/tests/test_ext_math.py
index 517ba30c8..c858afcd2 100644
--- a/tests/test_ext_math.py
+++ b/tests/test_ext_math.py
@@ -14,6 +14,22 @@ import re
from util import with_app, SkipTest
+@with_app(buildername='html', testroot='ext-math',
+ confoverrides = {'extensions': ['sphinx.ext.jsmath'], 'jsmath_path': 'dummy.js'})
+def test_jsmath(app, status, warning):
+ app.builder.build_all()
+ content = (app.outdir / 'math.html').text()
+
+ assert '\na^2 + b^2 = c^2
' in content
+ assert '\n\\begin{split}a + 1 < b\\end{split}
' in content
+ assert ('(1)\n'
+ 'e^{i\\pi} = 1
' in content)
+ assert ('(2)\n'
+ 'e^{ix} = \\cos x + i\\sin x
' in content)
+ assert '\nn \\in \\mathbb N
' in content
+ assert '\na + 1 < b
' in content
+
+
@with_app('html', testroot='ext-math-simple',
confoverrides = {'extensions': ['sphinx.ext.imgmath']})
def test_imgmath_png(app, status, warning):