diff options
author | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2022-07-17 21:53:12 +0100 |
---|---|---|
committer | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2022-07-17 21:53:12 +0100 |
commit | a4d41aa889388bf8ee2815d4819235b5ca978a8d (patch) | |
tree | 67763bc78a88f0114ff22e50f8419213dc0ff4ef /tests/test_build_html.py | |
parent | 1e3ade55fe24107c883fc2725ecab28350e3f6cb (diff) | |
parent | aa47f5d53aa3327aa0acf2aeb25996b3b3ba6898 (diff) | |
download | sphinx-git-a4d41aa889388bf8ee2815d4819235b5ca978a8d.tar.gz |
Merge branch '5.x'
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r-- | tests/test_build_html.py | 21 |
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 |