Issue21238
Created on 2014-04-15 15:51 by michael.foord, last changed 2015-07-16 22:51 by John Allison. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue21238.patch | kushal.das, 2014-04-16 16:00 | Patch with docs and test changes. | review | |
| Messages (7) | |||
|---|---|---|---|
| msg216320 - (view) | Author: Michael Foord (michael.foord) * | Date: 2014-04-15 15:51 | |
A common problem with unittest.mock.Mock is to mistype an assert method. Because mocks create attributes on demand your test will pass without error. We should raise an AttributeError if you access any attribute name (that doesn't exist) starting with assert or assret. There should also be a keyword argument allowing you to get the old behaviour if you need it (but this new feature should be on by default). Will also need docs. |
|||
| msg216481 - (view) | Author: Kushal Das (kushal.das) * | Date: 2014-04-16 16:00 | |
Patch with docs and test changes. |
|||
| msg216518 - (view) | Author: Michael Foord (michael.foord) * | Date: 2014-04-16 17:50 | |
It needs a NEWS entry, but looks good to me. |
|||
| msg216534 - (view) | Author: Roundup Robot (python-dev) | Date: 2014-04-16 18:06 | |
New changeset e4ee0b15cc4f by Kushal Das in branch 'default': Closes Issue 21238: New keyword argument `unsafe` to Mock. http://hg.python.org/cpython/rev/e4ee0b15cc4f |
|||
| msg246689 - (view) | Author: Dima Tisnek (Dima.Tisnek) * | Date: 2015-07-13 12:07 | |
What is this **assret** spelling? I can't a reference to this spelling anywhere else in the codebase, let alone any docs other that this special kwarg. It seems intentional. Was that a joke? Or something I should know? |
|||
| msg246690 - (view) | Author: Kushal Das (kushal.das) * | Date: 2015-07-13 12:16 | |
It is a typing mistake many people make. We just want to catch those as otherwise mock will silently pass those. |
|||
| msg246836 - (view) | Author: John Allison (John Allison) | Date: 2015-07-16 22:51 | |
That probably IS a joke. Why not fix the underlying issue instead? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2015-07-16 22:51:51 | John Allison | set | nosy:
+ John Allison messages: + msg246836 |
| 2015-07-13 12:16:38 | kushal.das | set | messages: + msg246690 |
| 2015-07-13 12:07:42 | Dima.Tisnek | set | nosy:
+ Dima.Tisnek messages: + msg246689 |
| 2014-04-16 18:06:58 | python-dev | set | status: open -> closed nosy:
+ python-dev resolution: fixed |
| 2014-04-16 17:50:21 | michael.foord | set | messages: + msg216518 |
| 2014-04-16 16:00:43 | kushal.das | set | files:
+ issue21238.patch keywords: + patch messages: + msg216481 |
| 2014-04-15 15:51:18 | michael.foord | create | |