Fix the warnings, need to handle the repr escaping

This commit is contained in:
Andy Neebel 2017-05-01 16:19:53 -05:00
parent f68c108f10
commit db8663db06
3 changed files with 3 additions and 6 deletions

View File

@ -145,10 +145,9 @@ def check_extra_entries(outdir):
@pytest.mark.sphinx('html', testroot='warnings')
@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows")
def test_html_warnings(app, warning):
app.build()
html_warnings = strip_escseq(warning.getvalue().replace(os.sep, '/'))
html_warnings = strip_escseq(re.sub(re.escape(os.sep) + '{1,2}', '/', warning.getvalue()))
html_warnings_exp = HTML_WARNINGS % {
'root': re.escape(app.srcdir.replace(os.sep, '/'))}
assert re.match(html_warnings_exp + '$', html_warnings), \

View File

@ -152,11 +152,10 @@ def test_writer(app, status, warning):
@pytest.mark.sphinx('latex', testroot='warnings', freshenv=True)
@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows")
def test_latex_warnings(app, status, warning):
app.builder.build_all()
warnings = strip_escseq(warning.getvalue().replace(os.sep, '/'))
warnings = strip_escseq(re.sub(re.escape(os.sep) + '{1,2}', '/', warning.getvalue()))
warnings_exp = LATEX_WARNINGS % {
'root': re.escape(app.srcdir.replace(os.sep, '/'))}
assert re.match(warnings_exp + '$', warnings), \

View File

@ -35,10 +35,9 @@ if PY3:
@pytest.mark.sphinx('texinfo', testroot='warnings', freshenv=True)
@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows")
def test_texinfo_warnings(app, status, warning):
app.builder.build_all()
warnings = strip_escseq(warning.getvalue().replace(os.sep, '/'))
warnings = strip_escseq(re.sub(re.escape(os.sep) + '{1,2}', '/', warning.getvalue()))
warnings_exp = TEXINFO_WARNINGS % {
'root': re.escape(app.srcdir.replace(os.sep, '/'))}
assert re.match(warnings_exp + '$', warnings), \