From 219f024595fa77dcafbd2aed254259578482dd46 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 2 Sep 2018 16:17:02 +0900 Subject: [PATCH] Add testcase for pygments --- tests/test_build_html.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 93f1130bb..51732435e 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1389,20 +1389,21 @@ def test_html_math_renderer_is_mismatched(make_app, app_params): assert str(exc) == "Unknown math_renderer 'imgmath' is given." -@pytest.mark.sphinx('html', testroot='roles-download') -def test_html_download_role(app, status, warning): - app.build() - assert (app.outdir / '_downloads' / 'dummy.dat').exists() +@pytest.mark.sphinx('html', testroot='basic') +def test_html_pygments_style_default(app): + style = app.builder.highlighter.formatter_args.get('style') + assert style.__name__ == 'Alabaster' - content = (app.outdir / 'index.html').text() - assert ('
  • ' - '' - 'dummy.dat
  • ' in content) - assert ('
  • ' - 'not_found.dat
  • ' in content) - assert ('
  • ' - '' - 'Sphinx logo' - '
  • ' in content) + +@pytest.mark.sphinx('html', testroot='basic', + confoverrides={'pygments_style': 'sphinx'}) +def test_html_pygments_style_manually(app): + style = app.builder.highlighter.formatter_args.get('style') + assert style.__name__ == 'SphinxStyle' + + +@pytest.mark.sphinx('html', testroot='basic', + confoverrides={'html_theme': 'classic'}) +def test_html_pygments_for_classic_theme(app): + style = app.builder.highlighter.formatter_args.get('style') + assert style.__name__ == 'SphinxStyle'