Fix the test suite.

This commit is contained in:
Georg Brandl
2009-03-16 11:24:19 +01:00
parent 5f6c38f47a
commit 9d0a9f3f41
2 changed files with 7 additions and 5 deletions

View File

@@ -100,7 +100,7 @@ class NslessParser(ET.XMLParser):
return name
@with_app(buildername='html', warning=html_warnfile)
@with_app(buildername='html', warning=html_warnfile, cleanenv=True)
def test_html(app):
app.builder.build_all()
html_warnings = html_warnfile.getvalue().replace(os.sep, '/')
@@ -127,7 +127,7 @@ def test_html(app):
'path %s in %s' % (text, path, fname))
@with_app(buildername='latex', warning=latex_warnfile)
@with_app(buildername='latex', warning=latex_warnfile, cleanenv=True)
def test_latex(app):
LaTeXTranslator.ignore_missing_images = True
app.builder.build_all()
@@ -183,11 +183,11 @@ def test_latex(app):
# just let the remaining ones run for now
@with_app(buildername='linkcheck')
@with_app(buildername='linkcheck', cleanenv=True)
def test_linkcheck(app):
app.builder.build_all()
@with_app(buildername='text')
@with_app(buildername='text', cleanenv=True)
def test_text(app):
app.builder.build_all()

View File

@@ -23,7 +23,8 @@ from sphinx.latexwriter import LaTeXWriter, LaTeXTranslator
def setup_module():
global app, settings, parser
app = TestApp(cleanenv=True)
optparser = frontend.OptionParser(components=(rst.Parser, HTMLWriter, LaTeXWriter))
optparser = frontend.OptionParser(
components=(rst.Parser, HTMLWriter, LaTeXWriter))
settings = optparser.get_default_values()
settings.env = app.builder.env
parser = rst.Parser()
@@ -47,6 +48,7 @@ class ForgivingLaTeXTranslator(LaTeXTranslator, ForgivingTranslator):
def verify_re(rst, html_expected, latex_expected):
document = utils.new_document('test data', settings)
document['file'] = 'dummy'
parser.parse(rst, document)
for msg in document.traverse(nodes.system_message):
if msg['level'] == 1: