diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-08-01 16:59:00 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-08-01 16:59:00 +0900 |
commit | c14c00397e05946476b280d9914c2bef5af90f8d (patch) | |
tree | c140fdf7b963e845cc8a968614a9f197d6d719eb /tests/test_domain_py.py | |
parent | 9a2f2e15a6c2149a84d91f34f18695086dc47f90 (diff) | |
parent | 2644199e7eb2f9feaa54f4a47fad506b5259e11c (diff) | |
download | sphinx-git-c14c00397e05946476b280d9914c2bef5af90f8d.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r-- | tests/test_domain_py.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index d53c6a658..5d9974975 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -264,6 +264,14 @@ def test_parse_annotation(app): [desc_sig_punctuation, ")"], [desc_sig_punctuation, "]"])) + doctree = _parse_annotation("Tuple[int, ...]", app.env) + assert_node(doctree, ([pending_xref, "Tuple"], + [desc_sig_punctuation, "["], + [pending_xref, "int"], + [desc_sig_punctuation, ", "], + [desc_sig_punctuation, "..."], + [desc_sig_punctuation, "]"])) + doctree = _parse_annotation("Callable[[int, int], int]", app.env) assert_node(doctree, ([pending_xref, "Callable"], [desc_sig_punctuation, "["], @@ -276,6 +284,12 @@ def test_parse_annotation(app): [pending_xref, "int"], [desc_sig_punctuation, "]"])) + doctree = _parse_annotation("List[None]", app.env) + assert_node(doctree, ([pending_xref, "List"], + [desc_sig_punctuation, "["], + [pending_xref, "None"], + [desc_sig_punctuation, "]"])) + # None type makes an object-reference (not a class reference) doctree = _parse_annotation("None", app.env) assert_node(doctree, ([pending_xref, "None"],)) |