Skip to content

Commit 7628302

Browse files
committed
Change test_download_role to use abs reftarget on Windows
1 parent 1164146 commit 7628302

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_execute.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
from io import StringIO
66
from unittest.mock import Mock
7+
from pathlib import Path
78

89
from sphinx.addnodes import download_reference
910
from sphinx.testing.util import assert_node, SphinxTestApp, path
@@ -586,6 +587,11 @@ def test_download_role(text, reftarget, caption, tmp_path):
586587
}
587588
mock_inliner.configure_mock(**config)
588589
ret, msg = role('jupyter-download:notebook', text, text, 0, mock_inliner)
590+
591+
if os.name == "nt":
592+
# Get equivalent abs path for Windows
593+
reftarget = Path(os.path.join(tmp_path, reftarget[1:])).resolve().as_posix()
594+
589595
assert_node(ret[0], [download_reference], reftarget=reftarget)
590596
assert_node(ret[0][0], [literal, caption])
591597
assert msg == []

0 commit comments

Comments
 (0)