forked from sphinx-doc/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sphinx-doc#4260: autodoc: keyword only argument separator is not …
…disappeared
- Loading branch information
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
py3/test_util_inspect | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
Tests util.inspect functions. | ||
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. | ||
:license: BSD, see LICENSE for details. | ||
""" | ||
|
||
from sphinx.util import inspect | ||
|
||
|
||
def test_Signature_keyword_only_arguments(): | ||
def func1(arg1, arg2, *, arg3=None, arg4=None): | ||
pass | ||
|
||
def func2(*, arg3, arg4): | ||
pass | ||
|
||
sig = inspect.Signature(func1).format_args() | ||
assert sig == '(arg1, arg2, *, arg3=None, arg4=None)' | ||
|
||
sig = inspect.Signature(func2).format_args() | ||
assert sig == '(*, arg3, arg4)' |