mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-08-11 13:34:59 -05:00
HTML builder outputs HTML5 by default
This commit is contained in:
+18
-14
@@ -12,7 +12,11 @@ import re
|
||||
|
||||
import pytest
|
||||
|
||||
from sphinx.util import docutils
|
||||
|
||||
|
||||
@pytest.mark.skipif(docutils.__version_info__ < (0, 13),
|
||||
reason='docutils-0.13 or above is required')
|
||||
@pytest.mark.sphinx('html', testroot='ext-todo', freshenv=True,
|
||||
confoverrides={'todo_include_todos': True, 'todo_emit_warnings': True})
|
||||
def test_todo(app, status, warning):
|
||||
@@ -26,22 +30,22 @@ def test_todo(app, status, warning):
|
||||
|
||||
# check todolist
|
||||
content = (app.outdir / 'index.html').text()
|
||||
html = ('<p class="first admonition-title">Todo</p>\n'
|
||||
'<p class="last">todo in foo</p>')
|
||||
html = ('<p class="admonition-title">Todo</p>\n'
|
||||
'<p>todo in foo</p>')
|
||||
assert re.search(html, content, re.S)
|
||||
|
||||
html = ('<p class="first admonition-title">Todo</p>\n'
|
||||
'<p class="last">todo in bar</p>')
|
||||
html = ('<p class="admonition-title">Todo</p>\n'
|
||||
'<p>todo in bar</p>')
|
||||
assert re.search(html, content, re.S)
|
||||
|
||||
# check todo
|
||||
content = (app.outdir / 'foo.html').text()
|
||||
html = ('<p class="first admonition-title">Todo</p>\n'
|
||||
'<p class="last">todo in foo</p>')
|
||||
html = ('<p class="admonition-title">Todo</p>\n'
|
||||
'<p>todo in foo</p>')
|
||||
assert re.search(html, content, re.S)
|
||||
|
||||
html = ('<p class="first admonition-title">Todo</p>\n'
|
||||
'<p class="last">todo in param field</p>')
|
||||
html = ('<p class="admonition-title">Todo</p>\n'
|
||||
'<p>todo in param field</p>')
|
||||
assert re.search(html, content, re.S)
|
||||
|
||||
# check emitted warnings
|
||||
@@ -68,18 +72,18 @@ def test_todo_not_included(app, status, warning):
|
||||
|
||||
# check todolist
|
||||
content = (app.outdir / 'index.html').text()
|
||||
html = ('<p class="first admonition-title">Todo</p>\n'
|
||||
'<p class="last">todo in foo</p>')
|
||||
html = ('<p class="admonition-title">Todo</p>\n'
|
||||
'<p>todo in foo</p>')
|
||||
assert not re.search(html, content, re.S)
|
||||
|
||||
html = ('<p class="first admonition-title">Todo</p>\n'
|
||||
'<p class="last">todo in bar</p>')
|
||||
html = ('<p class="admonition-title">Todo</p>\n'
|
||||
'<p>todo in bar</p>')
|
||||
assert not re.search(html, content, re.S)
|
||||
|
||||
# check todo
|
||||
content = (app.outdir / 'foo.html').text()
|
||||
html = ('<p class="first admonition-title">Todo</p>\n'
|
||||
'<p class="last">todo in foo</p>')
|
||||
html = ('<p class="admonition-title">Todo</p>\n'
|
||||
'<p>todo in foo</p>')
|
||||
assert not re.search(html, content, re.S)
|
||||
|
||||
# check emitted warnings
|
||||
|
||||
Reference in New Issue
Block a user