summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2020-04-27 12:56:26 +0100
committerEric Wieser <wieser.eric@gmail.com>2020-04-27 12:57:39 +0100
commitb7ce4a4c13bf913eb97bed0c89ac31019d12a407 (patch)
tree72396eb20525b9165ed5805fa8043390b6465b00 /tests/test_autodoc.py
parent21ca43719a08ea4aada4f99e3422f408fcb96057 (diff)
downloadsphinx-git-b7ce4a4c13bf913eb97bed0c89ac31019d12a407.tar.gz
Fix a logic error that causes annotations not to be shown for descriptors
This `if not self._datadescriptor` was originally here before type annotations were supported, to prevent showing `descr4 = <_Descriptor ...>` in the docs. When type annotations were added, the support for appending `:type:` was put in the wrong place. It should have been outside this if, not within it.
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r--tests/test_autodoc.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index dd474536d..3bbd35513 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -1518,6 +1518,13 @@ def test_autodoc_typed_instance_variables(app):
' attr6',
'',
'',
+ ' .. py:attribute:: Class.descr4',
+ ' :module: target.typed_vars',
+ ' :type: int',
+ '',
+ ' This is descr4',
+ '',
+ '',
'.. py:data:: attr1',
' :module: target.typed_vars',
' :type: str',