summaryrefslogtreecommitdiff
path: root/tests/test_build_html.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r--tests/test_build_html.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index ff72b0aac..76a020d13 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -79,7 +79,7 @@ def tail_check(check):
for node in nodes:
if node.tail and rex.search(node.tail):
return True
- assert False, '%r not found in tail of any nodes %s' % (check, nodes)
+ raise AssertionError('%r not found in tail of any nodes %s' % (check, nodes))
return checker
@@ -114,9 +114,9 @@ def check_xpath(etree, fname, path, check, be_found=True):
if all(not rex.search(get_text(node)) for node in nodes):
return
- assert False, ('%r not found in any node matching '
- 'path %s in %s: %r' % (check, path, fname,
- [node.text for node in nodes]))
+ raise AssertionError(('%r not found in any node matching '
+ 'path %s in %s: %r' % (check, path, fname,
+ [node.text for node in nodes])))
@pytest.mark.sphinx('html', testroot='warnings')
@@ -1520,7 +1520,7 @@ def test_html_math_renderer_is_duplicated(make_app, app_params):
try:
args, kwargs = app_params
make_app(*args, **kwargs)
- assert False
+ raise AssertionError()
except ConfigError as exc:
assert str(exc) == ('Many math_renderers are registered. '
'But no math_renderer is selected.')
@@ -1550,7 +1550,7 @@ def test_html_math_renderer_is_mismatched(make_app, app_params):
try:
args, kwargs = app_params
make_app(*args, **kwargs)
- assert False
+ raise AssertionError()
except ConfigError as exc:
assert str(exc) == "Unknown math_renderer 'imgmath' is given."
@@ -1766,3 +1766,12 @@ def test_theme_options_with_override(app, status, warning):
result = (app.outdir / '_static' / 'documentation_options.js').read_text(encoding='utf8')
assert 'NAVIGATION_WITH_KEYS: true' in result
assert 'ENABLE_SEARCH_SHORTCUTS: false' in result
+
+
+@pytest.mark.sphinx('html', testroot='build-html-theme-having-multiple-stylesheets')
+def test_theme_having_multiple_stylesheets(app):
+ app.build()
+ content = (app.outdir / 'index.html').read_text(encoding='utf-8')
+
+ assert '<link rel="stylesheet" type="text/css" href="_static/mytheme.css" />' in content
+ assert '<link rel="stylesheet" type="text/css" href="_static/extra.css" />' in content