mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
py nodes, PyProperty
This commit is contained in:
parent
73ade60654
commit
8cd0847590
@ -889,7 +889,10 @@ class PyProperty(PyObject):
|
||||
typ = self.options.get('type')
|
||||
if typ:
|
||||
annotations = _parse_annotation(typ, self.env)
|
||||
signode += addnodes.desc_annotation(typ, '', nodes.Text(': '), *annotations)
|
||||
signode += addnodes.desc_annotation(typ, '',
|
||||
addnodes.desc_sig_punctuation('', ':'),
|
||||
addnodes.desc_sig_space(),
|
||||
*annotations)
|
||||
|
||||
return fullname, prefix
|
||||
|
||||
|
@ -876,14 +876,16 @@ def test_pyproperty(app):
|
||||
entries=[('single', 'prop1 (Class property)', 'Class.prop1', '', None)])
|
||||
assert_node(doctree[1][1][1], ([desc_signature, ([desc_annotation, "abstract property "],
|
||||
[desc_name, "prop1"],
|
||||
[desc_annotation, (": ",
|
||||
[desc_annotation, ([desc_sig_punctuation, ':'],
|
||||
desc_sig_space,
|
||||
[pending_xref, "str"])])],
|
||||
[desc_content, ()]))
|
||||
assert_node(doctree[1][1][2], addnodes.index,
|
||||
entries=[('single', 'prop2 (Class property)', 'Class.prop2', '', None)])
|
||||
assert_node(doctree[1][1][3], ([desc_signature, ([desc_annotation, "class property "],
|
||||
[desc_name, "prop2"],
|
||||
[desc_annotation, (": ",
|
||||
[desc_annotation, ([desc_sig_punctuation, ':'],
|
||||
desc_sig_space,
|
||||
[pending_xref, "str"])])],
|
||||
[desc_content, ()]))
|
||||
assert 'Class.prop1' in domain.objects
|
||||
|
Loading…
Reference in New Issue
Block a user