Fix EM10{1,2} (exception must not use a string)

This commit is contained in:
Adam Turner
2023-08-13 20:07:28 +01:00
committed by Adam Turner
parent ae0d97bb26
commit d80eab689d
48 changed files with 179 additions and 112 deletions

View File

@@ -29,9 +29,11 @@ def has_binary(binary):
def test_imgmath_png(app, status, warning):
app.builder.build_all()
if "LaTeX command 'latex' cannot be run" in warning.getvalue():
raise pytest.skip.Exception('LaTeX command "latex" is not available')
msg = 'LaTeX command "latex" is not available'
raise pytest.skip.Exception(msg)
if "dvipng command 'dvipng' cannot be run" in warning.getvalue():
raise pytest.skip.Exception('dvipng command "dvipng" is not available')
msg = 'dvipng command "dvipng" is not available'
raise pytest.skip.Exception(msg)
content = (app.outdir / 'index.html').read_text(encoding='utf8')
shutil.rmtree(app.outdir)
@@ -48,9 +50,11 @@ def test_imgmath_png(app, status, warning):
def test_imgmath_svg(app, status, warning):
app.builder.build_all()
if "LaTeX command 'latex' cannot be run" in warning.getvalue():
raise pytest.skip.Exception('LaTeX command "latex" is not available')
msg = 'LaTeX command "latex" is not available'
raise pytest.skip.Exception(msg)
if "dvisvgm command 'dvisvgm' cannot be run" in warning.getvalue():
raise pytest.skip.Exception('dvisvgm command "dvisvgm" is not available')
msg = 'dvisvgm command "dvisvgm" is not available'
raise pytest.skip.Exception(msg)
content = (app.outdir / 'index.html').read_text(encoding='utf8')
shutil.rmtree(app.outdir)
@@ -68,9 +72,11 @@ def test_imgmath_svg(app, status, warning):
def test_imgmath_svg_embed(app, status, warning):
app.builder.build_all()
if "LaTeX command 'latex' cannot be run" in warning.getvalue():
pytest.skip('LaTeX command "latex" is not available')
msg = 'LaTeX command "latex" is not available'
raise pytest.skip.Exception(msg)
if "dvisvgm command 'dvisvgm' cannot be run" in warning.getvalue():
pytest.skip('dvisvgm command "dvisvgm" is not available')
msg = 'dvisvgm command "dvisvgm" is not available'
raise pytest.skip.Exception(msg)
content = (app.outdir / 'index.html').read_text(encoding='utf8')
shutil.rmtree(app.outdir)