summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/mock.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #23641: Added __getnewargs_ex__ to the list of special mock attributes.Serhiy Storchaka2016-06-191-0/+1
|\
| * Issue #23641: Added __getnewargs_ex__ to the list of special mock attributes.Serhiy Storchaka2016-06-191-0/+1
| |
* | Issue #21271: Adds new keyword only parameters in reset_mock callKushal Das2016-06-021-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 Collins2016-05-161-0/+2
|\ \ | |/ | | | | Patch from Yolanda Robla.
| * Issue #26807: mock_open 'files' no longer error on readline at end of file.Robert Collins2016-05-161-0/+2
| | | | | | | | Patch from Yolanda Robla.
* | Issue #25195: Fix a regression in mock.MagicMockBerker Peksag2016-03-271-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.MagicMockBerker Peksag2016-03-271-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 Stinner2016-03-111-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 Kumaran2016-01-121-1/+1
|/ | | | Patch contributed by Robert Zimmerman.
* Issue #22138: Fix mock.patch behavior when patching descriptors. RestoreSenthil Kumaran2016-01-091-1/+4
| | | | | | original values after patching. Patch contributed by Sean McCully.
* Issue #24857: Comparing call_args to a long sequence now correctly returns aBerker Peksag2015-09-091-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 aBerker Peksag2015-09-091-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 Peksag2015-08-061-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 Peksag2015-08-061-3/+4
| | | | | | | | | | | | read_data is bytes. Initial patch by Aaron Hill.
* | Issue #21750: Further fixup to be styled like other mock APIs.Robert Collins2015-07-231-36/+43
|\ \ | |/
| * Issue #21750: Further fixup to be styled like other mock APIs.Robert Collins2015-07-231-36/+43
| |
* | Typo fix in mock.patch.Robert Collins2015-07-171-1/+1
|\ \ | |/ | | | | Patch from https://github.com/testing-cabal/mock/issues/215
| * Typo fix in mock.patch.Robert Collins2015-07-171-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 itRobert Collins2015-07-171-33/+37
|\ \ | |/ | | | | could in Python 3.3.
| * Issue #21750: mock_open.read_data can now be read from each instance, as itRobert Collins2015-07-171-33/+37
| | | | | | | | could in Python 3.3.
* | - Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely.Robert Collins2015-07-141-3/+9
|\ \ | |/ | | | | Patch from Nicola Palumbo and Laurent De Buyst.
| * - Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely.Robert Collins2015-07-141-3/+9
| | | | | | | | Patch from Nicola Palumbo and Laurent De Buyst.
| * Issue #23310: Fix MagicMock's initializer to work with __methods__.Łukasz Langa2015-04-141-2/+3
| | | | | | | | Behavior equivalent to m.configure_mock(). Patch by Kasia Jachim.
* | Issue #23661: unittest.mock side_effects can now be exceptions again.Robert Collins2015-07-141-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 Langa2015-04-141-2/+3
| | | | | | | | Behavior equivalent to m.configure_mock(). Patch by Kasia Jachim.
* | Issue #23568: Add rdivmod support to MagicMock() objects.Berker Peksag2015-03-141-1/+3
|\ \ | |/ | | | | Patch by Håkan Lövdahl.
| * Issue #23568: Add rdivmod support to MagicMock() objects.Berker Peksag2015-03-141-1/+3
| | | | | | | | Patch by Håkan Lövdahl.
* | Issue #23581: Add matmul support to MagicMock.Berker Peksag2015-03-121-1/+1
| | | | | | | | Patch by Håkan Lövdahl.
* | Issue #23326: Removed __ne__ implementations. Since fixing default __ne__Serhiy Storchaka2015-01-311-4/+0
| | | | | | | | implementation in issue #21408 they are redundant.
* | Issue #22823: Fix typo in unittest/mock.pyVictor Stinner2014-12-111-1/+1
| |
* | Issue #22823: Use set literals instead of creating a set from a list.Serhiy Storchaka2014-12-111-16/+15
| | | | | | | | Fixed an output of sets in examples.
* | Closes #21270 : We now override tuple methods in mock.call objects.Kushal Das2014-09-161-0/+6
| |
* | Closes #21256: Printout of keyword args in deterministic order in mock calls.Kushal Das2014-06-091-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 Das2014-04-161-1/+1
| |
* | Closes Issue 21262: New method assert_not_called for Mock.Kushal Das2014-04-161-0/+8
| | | | | | | | It raises AssertionError if the mock has been called.
* | Closes Issue 21238: New keyword argument `unsafe` to Mock.Kushal Das2014-04-161-2/+6
| | | | | | | | | | It raises `AttributeError` incase of an attribute startswith assert or assret.
* | MergeMichael Foord2014-04-151-5/+10
|\ \ | |/
| * Closes issue 21239. unittest.mock.patch.stopall() did not work ↵Michael Foord2014-04-151-5/+10
| | | | | | | | deterministically when the same name was patched multiple times.
* | MergeKushal Das2014-04-151-0/+2
|\ \ | |/
| * Closes Issue 21222.Kushal Das2014-04-151-0/+2
| | | | | | | | Passing name keyword argument to mock.create_autospec now works.
* | Closes issue 17660. You no longer need to explicitly pass create=True when ↵Michael Foord2014-04-141-0/+7
|/ | | | patching builtin names.
* Issue 17826. Setting an iterable side_effect on a mock created by ↵Michael Foord2014-04-141-2/+13
| | | | create_autospec now works
* Issue 20968. unittest.mock.MagicMock now supports divisionMichael Foord2014-04-141-1/+3
|
* Issue #20189: Four additional builtin types (PyTypeObject,Larry Hastings2014-01-241-3/+16
| | | | | | PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type) have been modified to provide introspection information for builtins. Also: many additional Lib, test suite, and Argument Clinic fixes.
* Process DEFAULT values in mock side_effect that returns iterator.Andrew Svetlov2013-04-071-0/+2
|\ | | | | | | Patch by Michael Ford.
| * Process DEFAULT values in mock side_effect that returns iterator.Andrew Svetlov2013-04-071-0/+2
| | | | | | | | Patch by Michael Ford.
* | #17504: merge with 3.3.Ezio Melotti2013-03-241-3/+0
|\ \ | |/
| * #17504: remove duplicated sentence. Patch by Radu Voicilas.Ezio Melotti2013-03-241-3/+0
| |
* | Closes issue 17467. Add readline and readlines support to ↵Michael Foord2013-03-201-6/+49
| | | | | | | | unittest.mock.mock_open
* | Merge with 3.3, issue #17047: remove doubled words added in 3.3,Terry Jan Reedy2013-03-111-1/+1
|\ \ | |/ | | | | as reported by Serhiy Storchaka and Matthew Barnett.