Fix #6589: autodoc: Formatting issues with autodoc_typehints='none'

This commit is contained in:
Takeshi KOMIYA committed 2019-08-02 01:55:53 +09:00
1 parent 4732ec5edf
commit ace7b4ded7
4 files changed
+10 -5

No files matched your search

+3 -3
View File
@@ -501,15 +501,15 @@ def test_autodoc_typehints_none(app):
'.. py:module:: target.typehints',
'',
'',
'.. py:class:: Math(s, o = None)',
'.. py:class:: Math(s, o=None)',
' :module: target.typehints',
'',
' ',
' .. py:method:: Math.incr(a, b = 1) -> int',
' .. py:method:: Math.incr(a, b=1)',
' :module: target.typehints',
' ',
'',
'.. py:function:: incr(a, b = 1) -> int',
'.. py:function:: incr(a, b=1)',
' :module: target.typehints',
''
]
+4
View File
@@ -285,6 +285,10 @@ def test_Signature_annotations():
sig = inspect.Signature(Node.__init__).format_args()
assert sig == '(self, parent: Optional[Node]) -> None'
# show_annotation is False
sig = inspect.Signature(f7).format_args(show_annotation=False)
assert sig == '(x=None, y={})'
def test_safe_getattr_with_default():
class Foo: