summaryrefslogtreecommitdiff
path: root/tests/test_ext_inheritance_diagram.py
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2017-01-07 02:13:50 +0900
committershimizukawa <shimizukawa@gmail.com>2017-01-07 02:14:29 +0900
commit4c22cd10caa7b9621ece480fade5653d65226fcc (patch)
tree19a64268e9814dfa12087dc2d432c5339a23a0a9 /tests/test_ext_inheritance_diagram.py
parentf695aac2e28e1463385b399b61fc2c4b4ef40c5c (diff)
parent620616cdbd92147f6ea7bbeb670dc3a0562235ff (diff)
downloadsphinx-git-4c22cd10caa7b9621ece480fade5653d65226fcc.tar.gz
Merge branch 'stable'
Diffstat (limited to 'tests/test_ext_inheritance_diagram.py')
-rw-r--r--tests/test_ext_inheritance_diagram.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/test_ext_inheritance_diagram.py b/tests/test_ext_inheritance_diagram.py
index 0171cafe6..3ce4b23a5 100644
--- a/tests/test_ext_inheritance_diagram.py
+++ b/tests/test_ext_inheritance_diagram.py
@@ -11,13 +11,13 @@
import re
import sys
-from util import with_app, rootdir, raises
-from test_ext_graphviz import skip_if_graphviz_not_found
+from util import rootdir
from sphinx.ext.inheritance_diagram import InheritanceException, import_classes
+import pytest
-@with_app('html', testroot='ext-inheritance_diagram')
-@skip_if_graphviz_not_found
+@pytest.mark.sphinx('html', testroot='ext-inheritance_diagram')
+@pytest.mark.usefixtures('if_graphviz_found')
def test_inheritance_diagram_html(app, status, warning):
app.builder.build_all()
@@ -31,8 +31,8 @@ def test_inheritance_diagram_html(app, status, warning):
assert re.search(pattern, content, re.M)
-@with_app('latex', testroot='ext-inheritance_diagram')
-@skip_if_graphviz_not_found
+@pytest.mark.sphinx('latex', testroot='ext-inheritance_diagram')
+@pytest.mark.usefixtures('if_graphviz_found')
def test_inheritance_diagram_latex(app, status, warning):
app.builder.build_all()
@@ -53,8 +53,10 @@ def test_import_classes():
from example.sphinx import DummyClass
# got exception for unknown class or module
- raises(InheritanceException, import_classes, 'unknown', None)
- raises(InheritanceException, import_classes, 'unknown.Unknown', None)
+ with pytest.raises(InheritanceException):
+ import_classes('unknown', None)
+ with pytest.raises(InheritanceException):
+ import_classes('unknown.Unknown', None)
# a module having no classes
classes = import_classes('sphinx', None)
@@ -80,7 +82,8 @@ def test_import_classes():
assert classes == [CatalogInfo]
# got exception for functions
- raises(InheritanceException, import_classes, 'encode_uri', 'sphinx.util')
+ with pytest.raises(InheritanceException):
+ import_classes('encode_uri', 'sphinx.util')
# import submodule on current module (refs: #3164)
classes = import_classes('sphinx', 'example')