Merge pull request #5371 from tk0miya/5282_testcase_for_pygments

testcases and CHANGES for #5282
This commit is contained in:
Takeshi KOMIYA 2018-09-02 17:19:25 +09:00 committed by GitHub
commit 855ebfbbf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 16 deletions

View File

@ -7,6 +7,9 @@ Dependencies
Incompatible changes Incompatible changes
-------------------- --------------------
* #5282: html theme: refer ``pygments_style`` settings of HTML themes
preferentially
Deprecated Deprecated
---------- ----------
@ -25,6 +28,10 @@ Bugs fixed
* C++, fixes for symbol addition and lookup. Lookup should no longer break * C++, fixes for symbol addition and lookup. Lookup should no longer break
in partial builds. See also #5337. in partial builds. See also #5337.
* #5348: download reference to remote file is not displayed * #5348: download reference to remote file is not displayed
* #5282: html theme: ``pygments_style`` of theme was overrided by ``conf.py``
by default
quickstart: set conf.py pygments_style value to None #5282
Testing Testing
-------- --------

View File

@ -1389,20 +1389,21 @@ def test_html_math_renderer_is_mismatched(make_app, app_params):
assert str(exc) == "Unknown math_renderer 'imgmath' is given." assert str(exc) == "Unknown math_renderer 'imgmath' is given."
@pytest.mark.sphinx('html', testroot='roles-download') @pytest.mark.sphinx('html', testroot='basic')
def test_html_download_role(app, status, warning): def test_html_pygments_style_default(app):
app.build() style = app.builder.highlighter.formatter_args.get('style')
assert (app.outdir / '_downloads' / 'dummy.dat').exists() assert style.__name__ == 'Alabaster'
content = (app.outdir / 'index.html').text()
assert ('<li><a class="reference download internal" download="" ' @pytest.mark.sphinx('html', testroot='basic',
'href="_downloads/dummy.dat">' confoverrides={'pygments_style': 'sphinx'})
'<code class="xref download docutils literal notranslate">' def test_html_pygments_style_manually(app):
'<span class="pre">dummy.dat</span></code></a></li>' in content) style = app.builder.highlighter.formatter_args.get('style')
assert ('<li><code class="xref download docutils literal notranslate">' assert style.__name__ == 'SphinxStyle'
'<span class="pre">not_found.dat</span></code></li>' in content)
assert ('<li><a class="reference download external" download="" '
'href="http://www.sphinx-doc.org/en/master/_static/sphinxheader.png">' @pytest.mark.sphinx('html', testroot='basic',
'<code class="xref download docutils literal notranslate">' confoverrides={'html_theme': 'classic'})
'<span class="pre">Sphinx</span> <span class="pre">logo</span>' def test_html_pygments_for_classic_theme(app):
'</code></a></li>' in content) style = app.builder.highlighter.formatter_args.get('style')
assert style.__name__ == 'SphinxStyle'