mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix tests
This commit is contained in:
parent
44fbd39ab2
commit
f655835338
@ -1,4 +1,4 @@
|
|||||||
[theme]
|
[theme]
|
||||||
inherit = classic
|
inherit = classic
|
||||||
sidebars = globaltoc.html, searchbox.html
|
sidebars = globaltoc.html, searchbox.html
|
||||||
pygments_dark = monokai
|
pygments_dark_style = monokai
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import alabaster
|
import alabaster
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
import pytest
|
||||||
from sphinx.theming import ThemeError
|
from sphinx.theming import ThemeError
|
||||||
|
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ def test_staticfiles(app, status, warning):
|
|||||||
|
|
||||||
@pytest.mark.sphinx(testroot='theming',
|
@pytest.mark.sphinx(testroot='theming',
|
||||||
confoverrides={'html_theme': 'test-theme'})
|
confoverrides={'html_theme': 'test-theme'})
|
||||||
def test_staticfiles(app, status, warning):
|
def test_dark_style(app, status, warning):
|
||||||
style = app.builder.dark_highlighter.formatter_args.get('style')
|
style = app.builder.dark_highlighter.formatter_args.get('style')
|
||||||
assert style.__name__ == 'MonokaiStyle'
|
assert style.__name__ == 'MonokaiStyle'
|
||||||
|
|
||||||
@ -127,10 +127,10 @@ def test_staticfiles(app, status, warning):
|
|||||||
assert (app.outdir / '_static' / 'pygments_dark.css').exists()
|
assert (app.outdir / '_static' / 'pygments_dark.css').exists()
|
||||||
|
|
||||||
result = (app.outdir / 'index.html').read_text()
|
result = (app.outdir / 'index.html').read_text()
|
||||||
assert '<link rel="stylesheet" href="_static/pygments.css" type="text/css">' in result
|
assert '<link rel="stylesheet" href="_static/pygments.css" type="text/css" />' in result
|
||||||
assert ('<link rel="stylesheet" href="_static/pygments_dark.css"'
|
assert ('<link id="pygments_dark_css" media="(prefers-color-scheme: dark)" '
|
||||||
'type="text/css" media="(prefers-color-scheme: dark)"'
|
'rel="stylesheet" type="text/css" '
|
||||||
'id="pygments_dark_css">') in result
|
'href="_static/pygments_dark.css" />') in result
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx(testroot='theming')
|
@pytest.mark.sphinx(testroot='theming')
|
||||||
|
Loading…
Reference in New Issue
Block a user