From cca88c212be8f030a614cfe2c9c2d1d88b7e9074 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 25 Jul 2015 16:43:08 +0200 Subject: [PATCH] graphviz test: raise Skip if dot not available, instead of just passing --- tests/test_ext_graphviz.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/test_ext_graphviz.py b/tests/test_ext_graphviz.py index 53f5be4df..d0cbbc42f 100644 --- a/tests/test_ext_graphviz.py +++ b/tests/test_ext_graphviz.py @@ -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 = ('

\s*\s*

\s*' - '

caption of graph') - 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 = ('

\s*\s*

\s*' + '

caption of graph') + assert re.search(html, content, re.S)