summaryrefslogtreecommitdiff
path: root/tests/test_domain_py.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-07-05 00:13:23 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-07-05 00:13:23 +0900
commitfa9dc7c69878a11f543feb24a40e360f0fa1ecee (patch)
tree9b7b6ed8cbcd12cf070adc42e24ce7d87c71a88b /tests/test_domain_py.py
parent44f4b2ad97bd36f938b1a64462ebb466334c8c80 (diff)
parente7c2949a872c0654428c6bd1bea29659a65c684e (diff)
downloadsphinx-git-fa9dc7c69878a11f543feb24a40e360f0fa1ecee.tar.gz
Merge tag 'v3.1.1'
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r--tests/test_domain_py.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
index 653ab1cd4..9219a0bec 100644
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -681,7 +681,7 @@ def test_pyattribute(app):
text = (".. py:class:: Class\n"
"\n"
" .. py:attribute:: attr\n"
- " :type: str\n"
+ " :type: Optional[str]\n"
" :value: ''\n")
domain = app.env.get_domain('py')
doctree = restructuredtext.parse(app, text)
@@ -694,7 +694,10 @@ def test_pyattribute(app):
entries=[('single', 'attr (Class attribute)', 'Class.attr', '', None)])
assert_node(doctree[1][1][1], ([desc_signature, ([desc_name, "attr"],
[desc_annotation, (": ",
- [pending_xref, "str"])],
+ [pending_xref, "Optional"],
+ [desc_sig_punctuation, "["],
+ [pending_xref, "str"],
+ [desc_sig_punctuation, "]"])],
[desc_annotation, " = ''"])],
[desc_content, ()]))
assert 'Class.attr' in domain.objects