mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #5371 from tk0miya/5282_testcase_for_pygments
testcases and CHANGES for #5282
This commit is contained in:
commit
855ebfbbf5
7
CHANGES
7
CHANGES
@ -7,6 +7,9 @@ Dependencies
|
||||
Incompatible changes
|
||||
--------------------
|
||||
|
||||
* #5282: html theme: refer ``pygments_style`` settings of HTML themes
|
||||
preferentially
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
||||
@ -25,6 +28,10 @@ Bugs fixed
|
||||
* C++, fixes for symbol addition and lookup. Lookup should no longer break
|
||||
in partial builds. See also #5337.
|
||||
* #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
|
||||
--------
|
||||
|
@ -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 ('<li><a class="reference download internal" download="" '
|
||||
'href="_downloads/dummy.dat">'
|
||||
'<code class="xref download docutils literal notranslate">'
|
||||
'<span class="pre">dummy.dat</span></code></a></li>' in content)
|
||||
assert ('<li><code class="xref download docutils literal notranslate">'
|
||||
'<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">'
|
||||
'<code class="xref download docutils literal notranslate">'
|
||||
'<span class="pre">Sphinx</span> <span class="pre">logo</span>'
|
||||
'</code></a></li>' 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'
|
||||
|
Loading…
Reference in New Issue
Block a user