mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-03 12:48:34 -06:00
Fix #6589: autodoc: Formatting issues with autodoc_typehints='none'
This commit is contained in:
1 parent
4732ec5edf
commit
ace7b4ded7
4 files changed
+10
-5
No files matched your search
@@ -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',
|
||||
''
|
||||
]
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user