diff options
author | shimizukawa <shimizukawa@gmail.com> | 2017-01-07 02:13:50 +0900 |
---|---|---|
committer | shimizukawa <shimizukawa@gmail.com> | 2017-01-07 02:14:29 +0900 |
commit | 4c22cd10caa7b9621ece480fade5653d65226fcc (patch) | |
tree | 19a64268e9814dfa12087dc2d432c5339a23a0a9 /tests/test_ext_graphviz.py | |
parent | f695aac2e28e1463385b399b61fc2c4b4ef40c5c (diff) | |
parent | 620616cdbd92147f6ea7bbeb670dc3a0562235ff (diff) | |
download | sphinx-git-4c22cd10caa7b9621ece480fade5653d65226fcc.tar.gz |
Merge branch 'stable'
Diffstat (limited to 'tests/test_ext_graphviz.py')
-rw-r--r-- | tests/test_ext_graphviz.py | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/tests/test_ext_graphviz.py b/tests/test_ext_graphviz.py index 7d464343f..45850f3ce 100644 --- a/tests/test_ext_graphviz.py +++ b/tests/test_ext_graphviz.py @@ -10,37 +10,12 @@ """ import re -import subprocess -from functools import wraps -from util import with_app, SkipTest +import pytest -def skip_if_graphviz_not_found(fn): - @wraps(fn) - def decorator(app, *args, **kwargs): - found = False - graphviz_dot = getattr(app.config, 'graphviz_dot', '') - try: - if graphviz_dot: - dot = subprocess.Popen([graphviz_dot, '-V'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) # show version - dot.communicate() - found = True - except OSError: # No such file or directory - pass - - if not found: - raise SkipTest('graphviz "dot" is not available') - - return fn(app, *args, **kwargs) - - return decorator - - -@with_app('html', testroot='ext-graphviz') -@skip_if_graphviz_not_found +@pytest.mark.sphinx('html', testroot='ext-graphviz') +@pytest.mark.usefixtures('if_graphviz_found') def test_graphviz_html(app, status, warning): app.builder.build_all() @@ -60,8 +35,8 @@ def test_graphviz_html(app, status, warning): assert re.search(html, content, re.S) -@with_app('latex', testroot='ext-graphviz') -@skip_if_graphviz_not_found +@pytest.mark.sphinx('latex', testroot='ext-graphviz') +@pytest.mark.usefixtures('if_graphviz_found') def test_graphviz_latex(app, status, warning): app.builder.build_all() @@ -80,8 +55,8 @@ def test_graphviz_latex(app, status, warning): assert re.search(macro, content, re.S) -@with_app('html', testroot='ext-graphviz', confoverrides={'language': 'xx'}) -@skip_if_graphviz_not_found +@pytest.mark.sphinx('html', testroot='ext-graphviz', confoverrides={'language': 'xx'}) +@pytest.mark.usefixtures('if_graphviz_found') def test_graphviz_i18n(app, status, warning): app.builder.build_all() |