diff options
author | Takayuki SHIMIZUKAWA <shimizukawa@gmail.com> | 2017-01-07 00:48:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-07 00:48:27 +0900 |
commit | 620616cdbd92147f6ea7bbeb670dc3a0562235ff (patch) | |
tree | d9e459cc62d2c1fe783aa665ab56680eca112ab6 /tests/test_ext_graphviz.py | |
parent | 54c8c012228559c3bf30011977984a60a9299e9b (diff) | |
parent | 89e1df0bba58fc8d420fd9f293c4e325e06fc431 (diff) | |
download | sphinx-git-620616cdbd92147f6ea7bbeb670dc3a0562235ff.tar.gz |
Merge pull request #3302 from sphinx-doc/pytest-stable
pytest migration
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() |