Created on 2014-04-14 19:54 by kushal.das, last changed 2020-07-03 22:34 by steve.dower. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue21222.patch | kushal.das, 2014-04-14 22:00 | review | ||
| issue21222_v2.patch | kushal.das, 2014-04-15 17:32 | New patchset with changes made as suggested. | review | |
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 21304 | open | steve.dower, 2020-07-03 22:33 | |
| Messages (7) | |||
|---|---|---|---|
| msg216190 - (view) | Author: Kushal Das (kushal.das) * | Date: 2014-04-14 19:54 | |
>>> 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.
|
|||
| msg216230 - (view) | Author: Kushal Das (kushal.das) * | Date: 2014-04-14 22:00 | |
Fix for the issue with test case. We are checking name in keyword arguments, if found replace _name with it and delete it from keyword arguments. |
|||
| msg216311 - (view) | Author: Michael Foord (michael.foord) * | Date: 2014-04-15 15:37 | |
You can use kwargs.pop instead of the two step fetch and delete. For the test, could you add an assert that the name is used. Can you add an extra underscore to the method name, to make it: test_create_autospec_with_name |
|||
| msg216343 - (view) | Author: Kushal Das (kushal.das) * | Date: 2014-04-15 17:32 | |
New patchset with changes made as suggested. |
|||
| msg216367 - (view) | Author: Michael Foord (michael.foord) * | Date: 2014-04-15 19:28 | |
Looks good to me, but please change qobj and add a NEWS entry. |
|||
| msg216371 - (view) | Author: Roundup Robot (python-dev) | Date: 2014-04-15 19:53 | |
New changeset d471b0d38516 by Kushal Das in branch '3.4': Closes Issue 21222. http://hg.python.org/cpython/rev/d471b0d38516 |
|||
| msg372968 - (view) | Author: Steve Dower (steve.dower) * | Date: 2020-07-03 22:34 | |
New changeset 941117aaa32bf8b02c739ad848ac727292f75b05 by Steve Dower in branch '3.9': bpo-21222: Fix improperly merged change so that final hooks are called before types are cleared (GH-21304) https://github.com/python/cpython/commit/941117aaa32bf8b02c739ad848ac727292f75b05 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-07-03 22:34:53 | steve.dower | set | messages: + msg372968 |
| 2020-07-03 22:33:21 | steve.dower | set | nosy:
+ steve.dower pull_requests: + pull_request20455 |
| 2020-07-03 22:32:54 | steve.dower | set | nosy:
- steve.dower |
| 2020-07-03 22:32:47 | steve.dower | set | pull_requests: - pull_request20453 |
| 2020-07-03 22:06:09 | steve.dower | set | nosy:
+ steve.dower pull_requests: + pull_request20453 |
| 2014-04-15 19:53:09 | python-dev | set | status: open -> closed nosy:
+ python-dev resolution: fixed |
| 2014-04-15 19:28:42 | michael.foord | set | messages: + msg216367 |
| 2014-04-15 17:32:17 | kushal.das | set | files:
+ issue21222_v2.patch messages: + msg216343 |
| 2014-04-15 15:37:44 | michael.foord | set | nosy:
+ michael.foord messages: + msg216311 |
| 2014-04-14 22:00:43 | kushal.das | set | files:
+ issue21222.patch keywords: + patch messages: + msg216230 |
| 2014-04-14 19:54:11 | kushal.das | create | |