mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3933 from goodspark/py-rtype-xref
Python rtypes should match classes, not all objects
This commit is contained in:
commit
0f4262c391
@ -189,7 +189,7 @@ class PyObject(ObjectDescription):
|
||||
Field('returnvalue', label=l_('Returns'), has_arg=False,
|
||||
names=('returns', 'return')),
|
||||
PyField('returntype', label=l_('Return type'), has_arg=False,
|
||||
names=('rtype',), bodyrolename='obj'),
|
||||
names=('rtype',), bodyrolename='class'),
|
||||
]
|
||||
|
||||
allow_nesting = False
|
||||
|
@ -36,3 +36,5 @@ module
|
||||
:type x: int
|
||||
:param y: param y
|
||||
:type y: tuple(str, float)
|
||||
:rtype: list
|
||||
|
||||
|
@ -113,7 +113,8 @@ def test_domain_py_xrefs(app, status, warning):
|
||||
assert_refnode(refnodes[8], False, False, 'tuple', 'class')
|
||||
assert_refnode(refnodes[9], False, False, 'str', 'class')
|
||||
assert_refnode(refnodes[10], False, False, 'float', 'class')
|
||||
assert len(refnodes) == 11
|
||||
assert_refnode(refnodes[11], False, False, 'list', 'class')
|
||||
assert len(refnodes) == 12
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy', testroot='domain-py')
|
||||
|
Loading…
Reference in New Issue
Block a user