mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
graphviz test: raise Skip if dot not available, instead of just passing
This commit is contained in:
parent
f53fb63627
commit
cca88c212b
@ -10,14 +10,17 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
from util import with_app
|
||||
|
||||
from util import with_app, SkipTest
|
||||
|
||||
|
||||
@with_app('html', testroot='ext-graphviz')
|
||||
def test_graphviz(app, status, warning):
|
||||
app.builder.build_all()
|
||||
if "dot command 'dot' cannot be run" not in warning.getvalue():
|
||||
content = (app.outdir / 'index.html').text()
|
||||
html = ('<p class="graphviz">\s*<img .*?/>\s*</p>\s*'
|
||||
'<p class="caption"><span class="caption-text">caption of graph</span>')
|
||||
assert re.search(html, content, re.S)
|
||||
if "dot command 'dot' cannot be run" in warning.getvalue():
|
||||
raise SkipTest('graphviz "dot" is not available')
|
||||
|
||||
content = (app.outdir / 'index.html').text()
|
||||
html = ('<p class="graphviz">\s*<img .*?/>\s*</p>\s*'
|
||||
'<p class="caption"><span class="caption-text">caption of graph</span>')
|
||||
assert re.search(html, content, re.S)
|
||||
|
Loading…
Reference in New Issue
Block a user