mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Make test suite work with docutils from trunk: they emit a line number for a warning where 0.6 doesnt.
This commit is contained in:
parent
d1bf155cfe
commit
af51c2f7bb
@ -41,20 +41,21 @@ ENV_WARNINGS = """\
|
|||||||
%(root)s/images.txt:9: WARNING: image file not readable: foo.png
|
%(root)s/images.txt:9: WARNING: image file not readable: foo.png
|
||||||
%(root)s/images.txt:23: WARNING: nonlocal image URI found: \
|
%(root)s/images.txt:23: WARNING: nonlocal image URI found: \
|
||||||
http://www.python.org/logo.png
|
http://www.python.org/logo.png
|
||||||
%(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8-sig' used for reading \
|
%(root)s/includes.txt:\\d*: \\(WARNING/2\\) Encoding 'utf-8-sig' used for \
|
||||||
included file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option
|
reading included file u'wrongenc.inc' seems to be wrong, try giving an \
|
||||||
|
:encoding: option
|
||||||
%(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png
|
%(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png
|
||||||
"""
|
"""
|
||||||
|
|
||||||
HTML_WARNINGS = ENV_WARNINGS + """\
|
HTML_WARNINGS = ENV_WARNINGS + """\
|
||||||
%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.*'
|
%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\\*'
|
||||||
%(root)s/markup.txt:: WARNING: invalid index entry u''
|
%(root)s/markup.txt:: WARNING: invalid index entry u''
|
||||||
%(root)s/markup.txt:: WARNING: invalid pair index entry u''
|
%(root)s/markup.txt:: WARNING: invalid pair index entry u''
|
||||||
%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '
|
%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '
|
||||||
"""
|
"""
|
||||||
|
|
||||||
LATEX_WARNINGS = ENV_WARNINGS + """\
|
LATEX_WARNINGS = ENV_WARNINGS + """\
|
||||||
None:None: WARNING: no matching candidate for image URI u'foo.*'
|
None:None: WARNING: no matching candidate for image URI u'foo.\\*'
|
||||||
WARNING: invalid pair index entry u''
|
WARNING: invalid pair index entry u''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -185,8 +186,9 @@ def check_xpath(etree, fname, path, check):
|
|||||||
def test_html(app):
|
def test_html(app):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
html_warnings = html_warnfile.getvalue().replace(os.sep, '/')
|
html_warnings = html_warnfile.getvalue().replace(os.sep, '/')
|
||||||
html_warnings_exp = HTML_WARNINGS % {'root': app.srcdir}
|
html_warnings_exp = HTML_WARNINGS % {'root': re.escape(app.srcdir)}
|
||||||
assert html_warnings == html_warnings_exp, 'Warnings don\'t match:\n' + \
|
assert re.match(html_warnings_exp + '$', html_warnings), \
|
||||||
|
'Warnings don\'t match:\n' + \
|
||||||
'\n'.join(difflib.ndiff(html_warnings_exp.splitlines(),
|
'\n'.join(difflib.ndiff(html_warnings_exp.splitlines(),
|
||||||
html_warnings.splitlines()))
|
html_warnings.splitlines()))
|
||||||
|
|
||||||
@ -203,8 +205,9 @@ def test_latex(app):
|
|||||||
LaTeXTranslator.ignore_missing_images = True
|
LaTeXTranslator.ignore_missing_images = True
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
latex_warnings = latex_warnfile.getvalue().replace(os.sep, '/')
|
latex_warnings = latex_warnfile.getvalue().replace(os.sep, '/')
|
||||||
latex_warnings_exp = LATEX_WARNINGS % {'root': app.srcdir}
|
latex_warnings_exp = LATEX_WARNINGS % {'root': re.escape(app.srcdir)}
|
||||||
assert latex_warnings == latex_warnings_exp, 'Warnings don\'t match:\n' + \
|
assert re.match(latex_warnings_exp + '$', latex_warnings), \
|
||||||
|
'Warnings don\'t match:\n' + \
|
||||||
'\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(),
|
'\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(),
|
||||||
latex_warnings.splitlines()))
|
latex_warnings.splitlines()))
|
||||||
# file from latex_additional_files
|
# file from latex_additional_files
|
||||||
|
Loading…
Reference in New Issue
Block a user