[issue21222] Mock create_autospec with name argument fails

Kushal Das report at bugs.python.org
Mon Apr 14 21:54:11 CEST 2014


New submission from Kushal Das:

>>> from unittest import mock
>>> def b():
...   print("hello")
... 
>>> q = mock.create_autospec(b, name="a")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kdas/code/python/cpython3/Lib/unittest/mock.py", line 2092, in create_autospec
    name=_name, **_kwargs)
TypeError: type object got multiple values for keyword argument 'name'

The issue was originally reported on mock bug tracker. I am working on a patch for the same.

----------
components: Library (Lib)
messages: 216190
nosy: kushaldas
priority: normal
severity: normal
status: open
title: Mock create_autospec with name argument fails
type: behavior
versions: Python 3.5

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


More information about the Python-bugs-list mailing list