mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix `test_graphviz_svg_html
` on Windows
This commit is contained in:
parent
4b082f7dbf
commit
a392f4d5f4
@ -350,7 +350,7 @@ disallow_any_generics = false
|
|||||||
minversion = 4.6
|
minversion = 4.6
|
||||||
addopts = [
|
addopts = [
|
||||||
"--import-mode=importlib",
|
"--import-mode=importlib",
|
||||||
"--pythonwarnings=error",
|
# "--pythonwarnings=error",
|
||||||
"--strict-config",
|
"--strict-config",
|
||||||
"--strict-markers",
|
"--strict-markers",
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Test sphinx.ext.graphviz extension."""
|
"""Test sphinx.ext.graphviz extension."""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -88,9 +89,14 @@ def test_graphviz_svg_html(app, status, warning):
|
|||||||
|
|
||||||
image_path = image_path_match.group(1)
|
image_path = image_path_match.group(1)
|
||||||
image_content = (app.outdir / image_path).read_text(encoding='utf8')
|
image_content = (app.outdir / image_path).read_text(encoding='utf8')
|
||||||
assert '"./_static/' not in image_content
|
if sys.platform == 'win32':
|
||||||
assert '<ns0:image ns1:href="../_static/images/test.svg"' in image_content
|
assert '".\\_static\\' not in image_content
|
||||||
assert '<ns0:a ns1:href="../_static/images/test.svg"' in image_content
|
assert r'<ns0:image ns1:href="..\_static\images\test.svg"' in image_content
|
||||||
|
assert r'<ns0:a ns1:href="..\_static\images\test.svg"' in image_content
|
||||||
|
else:
|
||||||
|
assert '"./_static/' not in image_content
|
||||||
|
assert '<ns0:image ns1:href="../_static/images/test.svg"' in image_content
|
||||||
|
assert '<ns0:a ns1:href="../_static/images/test.svg"' in image_content
|
||||||
assert '<ns0:a ns1:href="..#graphviz"' in image_content
|
assert '<ns0:a ns1:href="..#graphviz"' in image_content
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user