summaryrefslogtreecommitdiffstats
path: root/tests/test_extensions/test_ext_inheritance_diagram.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/test_extensions/test_ext_inheritance_diagram.py (renamed from tests/test_ext_inheritance_diagram.py)20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_ext_inheritance_diagram.py b/tests/test_extensions/test_ext_inheritance_diagram.py
index 9ace5ad..c13ccea 100644
--- a/tests/test_ext_inheritance_diagram.py
+++ b/tests/test_extensions/test_ext_inheritance_diagram.py
@@ -33,7 +33,7 @@ def test_inheritance_diagram(app, status, warning):
InheritanceDiagram.run = new_run
try:
- app.builder.build_all()
+ app.build(force_all=True)
finally:
InheritanceDiagram.run = orig_run
@@ -160,7 +160,7 @@ def test_inheritance_diagram_png_html(tmp_path, app):
normalize_intersphinx_mapping(app, app.config)
load_mappings(app)
- app.builder.build_all()
+ app.build(force_all=True)
content = (app.outdir / 'index.html').read_text(encoding='utf8')
base_maps = re.findall('<map .+\n.+\n</map>', content)
@@ -171,7 +171,7 @@ def test_inheritance_diagram_png_html(tmp_path, app):
'class="inheritance graphviz" /></div>\n<figcaption>\n<p>'
'<span class="caption-text">Test Foo!</span><a class="headerlink" href="#id1" '
'title="Link to this image">\xb6</a></p>\n</figcaption>\n</figure>\n')
- assert re.search(pattern, content, re.M)
+ assert re.search(pattern, content, re.MULTILINE)
subdir_content = (app.outdir / 'subdir/page1.html').read_text(encoding='utf8')
subdir_maps = re.findall('<map .+\n.+\n</map>', subdir_content)
@@ -207,7 +207,7 @@ def test_inheritance_diagram_svg_html(tmp_path, app):
normalize_intersphinx_mapping(app, app.config)
load_mappings(app)
- app.builder.build_all()
+ app.build(force_all=True)
content = (app.outdir / 'index.html').read_text(encoding='utf8')
base_svgs = re.findall('<object data="(_images/inheritance-\\w+.svg?)"', content)
@@ -216,12 +216,12 @@ def test_inheritance_diagram_svg_html(tmp_path, app):
'<div class="graphviz">'
'<object data="_images/inheritance-\\w+.svg" '
'type="image/svg\\+xml" class="inheritance graphviz">\n'
- '<p class=\"warning\">Inheritance diagram of test.Foo</p>'
+ '<p class="warning">Inheritance diagram of test.Foo</p>'
'</object></div>\n<figcaption>\n<p><span class="caption-text">'
'Test Foo!</span><a class="headerlink" href="#id1" '
'title="Link to this image">\xb6</a></p>\n</figcaption>\n</figure>\n')
- assert re.search(pattern, content, re.M)
+ assert re.search(pattern, content, re.MULTILINE)
subdir_content = (app.outdir / 'subdir/page1.html').read_text(encoding='utf8')
subdir_svgs = re.findall('<object data="../(_images/inheritance-\\w+.svg?)"', subdir_content)
@@ -249,14 +249,14 @@ def test_inheritance_diagram_svg_html(tmp_path, app):
@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()
+ app.build(force_all=True)
content = (app.outdir / 'python.tex').read_text(encoding='utf8')
pattern = ('\\\\begin{figure}\\[htbp]\n\\\\centering\n\\\\capstart\n\n'
'\\\\sphinxincludegraphics\\[\\]{inheritance-\\w+.pdf}\n'
'\\\\caption{Test Foo!}\\\\label{\\\\detokenize{index:id1}}\\\\end{figure}')
- assert re.search(pattern, content, re.M)
+ assert re.search(pattern, content, re.MULTILINE)
@pytest.mark.sphinx('html', testroot='ext-inheritance_diagram',
@@ -264,7 +264,7 @@ def test_inheritance_diagram_latex(app, status, warning):
@pytest.mark.usefixtures('if_graphviz_found')
def test_inheritance_diagram_latex_alias(app, status, warning):
app.config.inheritance_alias = {'test.Foo': 'alias.Foo'}
- app.builder.build_all()
+ app.build(force_all=True)
doc = app.env.get_and_resolve_doctree('index', app)
aliased_graph = doc.children[0].children[3]['graph'].class_info
@@ -282,7 +282,7 @@ def test_inheritance_diagram_latex_alias(app, status, warning):
'class="inheritance graphviz" /></div>\n<figcaption>\n<p>'
'<span class="caption-text">Test Foo!</span><a class="headerlink" href="#id1" '
'title="Link to this image">\xb6</a></p>\n</figcaption>\n</figure>\n')
- assert re.search(pattern, content, re.M)
+ assert re.search(pattern, content, re.MULTILINE)
def test_import_classes(rootdir):