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

2012-04-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6f478a4aa137 by Michael Foord in branch 'default': Closes issue 14634. unittest.mock.create_autospec now supports keyword only arguments. http://hg.python.org/cpython/rev/6f478a4aa137 -- nosy: +python-dev resolution: -> fixed stage: test

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

2012-04-21 Thread Michael Foord
Michael Foord added the comment: Hmmm... looks like formatargspec does support these features but they aren't documented. If it works out I'll update the docs for inspect.formatargspec too. -- ___ Python tracker

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

2012-04-21 Thread Michael Foord
Changes by Michael Foord : -- keywords: -easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

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

2012-04-21 Thread Michael Foord
Michael Foord 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 easi

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

2012-04-20 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Library (Lib) nosy: +ezio.melotti stage: -> test needed ___ Python tracker ___ ___ Python-b

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

2012-04-20 Thread R. David Murray
New submission from R. David Murray : The following code: def foo(a, *, b=None): pass unittest.mock.create_autospec(foo) fails with this traceback: Traceback (most recent call last): File "temp.py", line 6, in unittest.mock.create_autospec(foo) File "/home/rdm