Closes issue 14634. unittest.mock.create_autospec now supports keyword only arguments.

This commit is contained in:
Michael Foord 2012-04-21 18:22:28 +01:00
parent 2cd48738ba
commit 3af125a4aa
3 changed files with 31 additions and 8 deletions

View file

@ -440,11 +440,16 @@ Classes and functions
locals dictionary of the given frame.
.. function:: formatargspec(args[, varargs, varkw, defaults, formatarg, formatvarargs, formatvarkw, formatvalue])
.. function:: formatargspec(args[, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations, formatarg, formatvarargs, formatvarkw, formatvalue, formatreturns, formatannotations])
Format a pretty argument spec from the four values returned by
:func:`getargspec`. The format\* arguments are the corresponding optional
formatting functions that are called to turn names and values into strings.
Format a pretty argument spec from the values returned by
:func:`getargspec` or :func:`getfullargspec`.
The first seven arguments are (``args``, ``varargs``, ``varkw``,
``defaults``, ``kwonlyargs``, ``kwonlydefaults``, ``annotations``). The
other five arguments are the corresponding optional formatting functions
that are called to turn names and values into strings. The last argument
is an optional function to format the sequence of arguments.
.. function:: formatargvalues(args[, varargs, varkw, locals, formatarg, formatvarargs, formatvarkw, formatvalue])