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 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | 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-28911: Clarify the behaviour of assert_called_once_with. (#251) | Arne de Laat | 2017-02-23 | 1 | -2/+2 |
| | |||||
* | Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY. | Serhiy Storchaka | 2017-01-21 | 1 | -2/+6 |
|\ | |||||
| * | Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY. | Serhiy Storchaka | 2017-01-21 | 1 | -2/+6 |
| |\ | |||||
| | * | Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY. | Serhiy Storchaka | 2017-01-21 | 1 | -2/+6 |
| | | | |||||
* | | | Issue #20804: The unittest.mock.sentinel attributes now preserve their | Serhiy Storchaka | 2017-01-11 | 1 | -0/+6 |
| | | | | | | | | | | | | identity when they are copied or pickled. | ||||
* | | | Merge 3.6 | Victor Stinner | 2017-01-06 | 1 | -2/+1 |
|\ \ \ | |/ / | |||||
| * | | Fix unittest.mock._Call: don't ignore name | Victor Stinner | 2017-01-06 | 1 | -2/+1 |
| | | | | | | | | | | | | | | | | | | | | | Issue #28961: Fix unittest.mock._Call helper: don't ignore the name parameter anymore. Patch written by Jiajun Huang. | ||||
* | | | Issue #28919: Simplify _copy_func_details() in unittest.mock | Berker Peksag | 2016-12-15 | 1 | -18/+8 |
|/ / | | | | | | | Patch by Jiajun Huang. | ||||
* | | Fixes issue28380: unittest.mock Mock autospec functions now properly support | Gregory P. Smith | 2016-10-06 | 1 | -0/+9 |
| | | | | | | | | assert_called, assert_not_called, and assert_called_once. | ||||
* | | Issue #26750: use inspect.isdatadescriptor instead of our own | Gregory P. Smith | 2016-08-16 | 1 | -7/+1 |
|\ \ | |/ | | | | | _is_data_descriptor(). | ||||
| * | Issue #26750: use inspect.isdatadescriptor instead of our own | Gregory P. Smith | 2016-08-16 | 1 | -7/+1 |
| | | | | | | | | _is_data_descriptor(). | ||||
* | | Issue #26750: unittest.mock.create_autospec() now works properly for | Gregory P. Smith | 2016-08-07 | 1 | -9/+5 |
|\ \ | |/ | | | | | | | subclasses of property() and other data descriptors. Removes the never publicly used, never documented unittest.mock.DescriptorTypes tuple. | ||||
| * | Issue #26750: unittest.mock.create_autospec() now works properly | Gregory P. Smith | 2016-08-07 | 1 | -1/+9 |
| | | | | | | | | for subclasses of property() and other data descriptors. | ||||
* | | Issue #23804: Merge spelling and NEWS fixes from 3.5 | Martin Panter | 2016-07-11 | 1 | -1/+1 |
|\ \ | |/ | |||||
| * | English spelling and grammar fixes | Martin Panter | 2016-07-11 | 1 | -1/+1 |
| | | |||||
* | | Issue #23641: Added __getnewargs_ex__ to the list of special mock attributes. | Serhiy Storchaka | 2016-06-19 | 1 | -0/+1 |
|\ \ | |/ | |||||
| * | Issue #23641: Added __getnewargs_ex__ to the list of special mock attributes. | Serhiy Storchaka | 2016-06-19 | 1 | -0/+1 |
| | | |||||
* | | Issue #21271: Adds new keyword only parameters in reset_mock call | Kushal Das | 2016-06-02 | 1 | -1/+6 |
| | | | | | | | | | | We now have two keyword only parameters in the reset_mock function to selectively reset the return_value or the side_effects, or both. | ||||
* | | Issue #26807: mock_open 'files' no longer error on readline at end of file. | Robert Collins | 2016-05-16 | 1 | -0/+2 |
|\ \ | |/ | | | | | Patch from Yolanda Robla. | ||||
| * | Issue #26807: mock_open 'files' no longer error on readline at end of file. | Robert Collins | 2016-05-16 | 1 | -0/+2 |
| | | | | | | | | Patch from Yolanda Robla. | ||||
* | | Issue #25195: Fix a regression in mock.MagicMock | Berker Peksag | 2016-03-27 | 1 | -0/+3 |
|\ \ | |/ | | | | | | | | | | | _Call is a subclass of tuple (changeset 3603bae63c13 only works for classes) so we need to implement __ne__ ourselves. Patch by Andrew Plummer. | ||||
| * | Issue #25195: Fix a regression in mock.MagicMock | Berker Peksag | 2016-03-27 | 1 | -0/+3 |
| | | | | | | | | | | | | | | _Call is a subclass of tuple (changeset 3603bae63c13 only works for classes) so we need to implement __ne__ ourselves. Patch by Andrew Plummer. | ||||
* | | Add Mock.assert_called() | Victor Stinner | 2016-03-11 | 1 | -0/+18 |
| | | | | | | | | | | Issue #26323: Add assert_called() and assert_called_once() methods to unittest.mock.Mock. | ||||
* | | Issue25347 - Format the error message output of mock's assert_has_calls method. | Senthil Kumaran | 2016-01-12 | 1 | -1/+1 |
|/ | | | | Patch contributed by Robert Zimmerman. | ||||
* | Issue #22138: Fix mock.patch behavior when patching descriptors. Restore | Senthil Kumaran | 2016-01-09 | 1 | -1/+4 |
| | | | | | | original values after patching. Patch contributed by Sean McCully. | ||||
* | Issue #24857: Comparing call_args to a long sequence now correctly returns a | Berker Peksag | 2015-09-09 | 1 | -2/+3 |
|\ | | | | | | | | | | | boolean result instead of raising an exception. Patch by A Kaptur. | ||||
| * | Issue #24857: Comparing call_args to a long sequence now correctly returns a | Berker Peksag | 2015-09-09 | 1 | -2/+3 |
| | | | | | | | | | | | | boolean result instead of raising an exception. Patch by A Kaptur. | ||||
* | | Issue #23004: mock_open() now reads binary data correctly when the type of ↵ | Berker Peksag | 2015-08-06 | 1 | -3/+4 |
|\ \ | |/ | | | | | | | | | read_data is bytes. Initial patch by Aaron Hill. | ||||
| * | Issue #23004: mock_open() now reads binary data correctly when the type of ↵ | Berker Peksag | 2015-08-06 | 1 | -3/+4 |
| | | | | | | | | | | | | read_data is bytes. Initial patch by Aaron Hill. | ||||
* | | Issue #21750: Further fixup to be styled like other mock APIs. | Robert Collins | 2015-07-23 | 1 | -36/+43 |
|\ \ | |/ | |||||
| * | Issue #21750: Further fixup to be styled like other mock APIs. | Robert Collins | 2015-07-23 | 1 | -36/+43 |
| | | |||||
* | | Typo fix in mock.patch. | Robert Collins | 2015-07-17 | 1 | -1/+1 |
|\ \ | |/ | | | | | Patch from https://github.com/testing-cabal/mock/issues/215 | ||||
| * | Typo fix in mock.patch. | Robert Collins | 2015-07-17 | 1 | -1/+1 |
| | | | | | | | | Patch from https://github.com/testing-cabal/mock/issues/215 | ||||
* | | Issue #21750: mock_open.read_data can now be read from each instance, as it | Robert Collins | 2015-07-17 | 1 | -33/+37 |
|\ \ | |/ | | | | | could in Python 3.3. | ||||
| * | Issue #21750: mock_open.read_data can now be read from each instance, as it | Robert Collins | 2015-07-17 | 1 | -33/+37 |
| | | | | | | | | could in Python 3.3. | ||||
* | | - Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely. | Robert Collins | 2015-07-14 | 1 | -3/+9 |
|\ \ | |/ | | | | | Patch from Nicola Palumbo and Laurent De Buyst. | ||||
| * | - Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely. | Robert Collins | 2015-07-14 | 1 | -3/+9 |
| | | | | | | | | Patch from Nicola Palumbo and Laurent De Buyst. | ||||
| * | Issue #23310: Fix MagicMock's initializer to work with __methods__. | Łukasz Langa | 2015-04-14 | 1 | -2/+3 |
| | | | | | | | | Behavior equivalent to m.configure_mock(). Patch by Kasia Jachim. | ||||
* | | Issue #23661: unittest.mock side_effects can now be exceptions again. | Robert Collins | 2015-07-14 | 1 | -1/+2 |
| | | | | | | | | This was a regression vs Python 3.4. Patch from Ignacio Rossi | ||||
* | | Issue #23310: Fix MagicMock's initializer to work with __methods__. | Łukasz Langa | 2015-04-14 | 1 | -2/+3 |
| | | | | | | | | Behavior equivalent to m.configure_mock(). Patch by Kasia Jachim. | ||||
* | | Issue #23568: Add rdivmod support to MagicMock() objects. | Berker Peksag | 2015-03-14 | 1 | -1/+3 |
|\ \ | |/ | | | | | Patch by Håkan Lövdahl. | ||||
| * | Issue #23568: Add rdivmod support to MagicMock() objects. | Berker Peksag | 2015-03-14 | 1 | -1/+3 |
| | | | | | | | | Patch by Håkan Lövdahl. | ||||
* | | Issue #23581: Add matmul support to MagicMock. | Berker Peksag | 2015-03-12 | 1 | -1/+1 |
| | | | | | | | | Patch by Håkan Lövdahl. | ||||
* | | Issue #23326: Removed __ne__ implementations. Since fixing default __ne__ | Serhiy Storchaka | 2015-01-31 | 1 | -4/+0 |
| | | | | | | | | implementation in issue #21408 they are redundant. | ||||
* | | Issue #22823: Fix typo in unittest/mock.py | Victor Stinner | 2014-12-11 | 1 | -1/+1 |
| | | |||||
* | | Issue #22823: Use set literals instead of creating a set from a list. | Serhiy Storchaka | 2014-12-11 | 1 | -16/+15 |
| | | | | | | | | Fixed an output of sets in examples. | ||||
* | | Closes #21270 : We now override tuple methods in mock.call objects. | Kushal Das | 2014-09-16 | 1 | -0/+6 |
| | | |||||
* | | Closes #21256: Printout of keyword args in deterministic order in mock calls. | Kushal Das | 2014-06-09 | 1 | -1/+1 |
| | | | | | | | | | | Printout of keyword args should be in deterministic order in a mock function call. This will help to write better doctests. | ||||
* | | Removes unused varargs and varkwargs from assert_not_called(). | Kushal Das | 2014-04-16 | 1 | -1/+1 |
| | |