mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Merge 3.4
This commit is contained in:
commit
42867c73c9
1 changed files with 2 additions and 2 deletions
|
@ -934,8 +934,8 @@ After the `MagicMock` has been used we can use attributes like
|
|||
the magic methods you specifically want:
|
||||
|
||||
>>> mock = Mock()
|
||||
>>> mock.__setitem__ = Mock(side_effect=getitem)
|
||||
>>> mock.__getitem__ = Mock(side_effect=setitem)
|
||||
>>> mock.__getitem__ = Mock(side_effect=getitem)
|
||||
>>> mock.__setitem__ = Mock(side_effect=setitem)
|
||||
|
||||
A *third* option is to use `MagicMock` but passing in `dict` as the `spec`
|
||||
(or `spec_set`) argument so that the `MagicMock` created only has
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue