summaryrefslogtreecommitdiff
path: root/tests/test_domain_py.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-05-02 22:44:08 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-05-04 14:30:20 +0900
commit88e8ebbe199c151a14d7df814807172f7565a073 (patch)
treec98c3da2c75f6bfbc81d243f1d87a7577e2ab155 /tests/test_domain_py.py
parent8f4c2fb08df49e13aab32bbac7eb87963f1536bd (diff)
downloadsphinx-git-88e8ebbe199c151a14d7df814807172f7565a073.tar.gz
Close #7596: py domain: Change a type annotation for variables to a hyperlink
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r--tests/test_domain_py.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
index 5a1d73cfe..08b3da21e 100644
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -420,7 +420,8 @@ def test_pydata_signature(app):
doctree = restructuredtext.parse(app, text)
assert_node(doctree, (addnodes.index,
[desc, ([desc_signature, ([desc_name, "version"],
- [desc_annotation, ": int"],
+ [desc_annotation, (": ",
+ [pending_xref, "int"])],
[desc_annotation, " = 1"])],
desc_content)]))
assert_node(doctree[1], addnodes.desc, desctype="data",
@@ -690,7 +691,8 @@ def test_pyattribute(app):
assert_node(doctree[1][1][0], addnodes.index,
entries=[('single', 'attr (Class attribute)', 'Class.attr', '', None)])
assert_node(doctree[1][1][1], ([desc_signature, ([desc_name, "attr"],
- [desc_annotation, ": str"],
+ [desc_annotation, (": ",
+ [pending_xref, "str"])],
[desc_annotation, " = ''"])],
[desc_content, ()]))
assert 'Class.attr' in domain.objects