This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cjw296
Recipients cjw296, michael.foord
Date 2013-02-11.22:31:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1360621900.03.0.519438692167.issue17185@psf.upfronthosting.co.za>
In-reply-to
Content
Sticking an issue in at Michael's request...

Older versions of mock had a helper called mocksignature.
In newer versions, create_autospec replaces this, but doesn't get it right sometimes:

>>> from inspect import getargspec
>>> from mock import create_autospec
>>> def myfunc(x, y): pass
...
>>> getargspec(myfunc)
ArgSpec(args=['x', 'y'], varargs=None, keywords=None, defaults=None)
>>> getargspec(create_autospec(myfunc))
ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)

mocksignature gets it right:

>>> from mock import mocksignature
>>> getargspec(mocksignature(myfunc))
ArgSpec(args=['x', 'y'], varargs=None, keywords=None, defaults=None)
History
Date User Action Args
2013-02-11 22:31:40cjw296setrecipients: + cjw296, michael.foord
2013-02-11 22:31:40cjw296setmessageid: <1360621900.03.0.519438692167.issue17185@psf.upfronthosting.co.za>
2013-02-11 22:31:40cjw296linkissue17185 messages
2013-02-11 22:31:39cjw296create