[issue14634] Mock cannot autospec functions with keyword-only arguments.

Michael Foord report at bugs.python.org
Sat Apr 21 18:49:52 CEST 2012


Michael Foord <michael at voidspace.org.uk> added the comment:

This is non-trivial to fix. Although inspect.getfullargspec can be used, which does support keyword only arguments, inspect.formatargspec *doesn't* support them. (mock.create_autospec uses these to rebuild a compatible signature for generated mocks.)

The easiest route to fixing would be to extend formatargspec to optionally take extra arguments for kwonlyargs and kwonlydefaults.

----------
assignee:  -> michael.foord

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14634>
_______________________________________


More information about the Python-bugs-list mailing list