Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bpo-29403: Fix mock's broken autospec behavior on method-bound builtin ↵ | Aaron Gallagher | 2017-07-20 | 1 | -0/+15 |
| | | | | | | | | | | | | | | | | | | | functions (GH-3) Cython will, in the right circumstances, offer a MethodType instance where im_func is a builtin function. Any instance of MethodType is automatically assumed to be a Python-defined function (more specifically, a function that has an inspectable signature), but _set_signature was still conservative in its assumptions. As a result _set_signature would return early with None instead of a mock since the im_func had no inspectable signature. This causes problems deeper inside mock, as _set_signature is assumed to _always_ return a mock, and nothing checked its return value. In similar corner cases, autospec will simply not check the spec of the function, so _set_signature is amended to now return early with the original, not-wrapped mock object. Patch by Aaron Gallagher. | ||||
* | bpo-28961: Address my comments from earlier code review (#305) | Berker Peksag | 2017-02-26 | 1 | -12/+3 |
| | |||||
* | Fix unittest.mock._Call: don't ignore name | Victor Stinner | 2017-01-06 | 1 | -0/+14 |
| | | | | | | | Issue #28961: Fix unittest.mock._Call helper: don't ignore the name parameter anymore. Patch written by Jiajun Huang. | ||||
* | Issue #26750: unittest.mock.create_autospec() now works properly | Gregory P. Smith | 2016-08-07 | 1 | -21/+39 |
| | | | | for subclasses of property() and other data descriptors. | ||||
* | Issue #19594: Use specific asserts in unittest tests. | Serhiy Storchaka | 2013-11-16 | 1 | -9/+9 |
|\ | |||||
| * | Issue #19594: Use specific asserts in unittest tests. | Serhiy Storchaka | 2013-11-16 | 1 | -9/+9 |
| | | |||||
* | | Issue #17015: When it has a spec, a Mock object now inspects its signature ↵ | Antoine Pitrou | 2013-02-02 | 1 | -20/+39 |
|/ | | | | when matching calls, so that arguments can be matched positionally or by name. | ||||
* | Fix exception when calling reset_mock on a mock created with autospec | Michael Foord | 2012-06-09 | 1 | -0/+7 |
| | |||||
* | Closes issue 14634. unittest.mock.create_autospec now supports keyword only ↵ | Michael Foord | 2012-04-21 | 1 | -1/+14 |
| | | | | arguments. | ||||
* | Make unittest.mock.create_autospec resilient against AttributeError on ↵ | Michael Foord | 2012-04-13 | 1 | -0/+23 |
| | | | | original object | ||||
* | unittest.mock.PropertyMock return value and attributes are now standard ↵ | Michael Foord | 2012-04-13 | 1 | -0/+11 |
| | | | | MagicMocks | ||||
* | PEP 417: Adding unittest.mock | Michael Foord | 2012-03-14 | 1 | -0/+835 |