Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

side_effects swapped in Mock example #65162

Closed
chris-buccella mannequin opened this issue Mar 17, 2014 · 3 comments
Closed

side_effects swapped in Mock example #65162

chris-buccella mannequin opened this issue Mar 17, 2014 · 3 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@chris-buccella
Copy link
Mannequin

chris-buccella mannequin commented Mar 17, 2014

BPO 20963
Nosy @merwok

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/merwok'
closed_at = <Date 2014-03-17.20:51:50.998>
created_at = <Date 2014-03-17.20:34:47.852>
labels = ['docs']
title = 'side_effects swapped in Mock example'
updated_at = <Date 2014-03-17.20:51:50.998>
user = 'https://bugs.python.org/chris-buccella'

bugs.python.org fields:

activity = <Date 2014-03-17.20:51:50.998>
actor = 'eric.araujo'
assignee = 'eric.araujo'
closed = True
closed_date = <Date 2014-03-17.20:51:50.998>
closer = 'eric.araujo'
components = ['Documentation']
creation = <Date 2014-03-17.20:34:47.852>
creator = 'chris-buccella'
dependencies = []
files = []
hgrepos = []
issue_num = 20963
keywords = []
message_count = 3.0
messages = ['213891', '213893', '213894']
nosy_count = 4.0
nosy_names = ['eric.araujo', 'docs@python', 'python-dev', 'chris-buccella']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue20963'
versions = ['Python 3.4', 'Python 3.5']

@chris-buccella
Copy link
Mannequin Author

chris-buccella mannequin commented Mar 17, 2014

http://docs.python.org/3.4/library/unittest.mock-examples.html

Section 26.5.3.9. Mocking a dictionary with MagicMock

In the Note area:

>> mock.__setitem__ = Mock(side_effect=getitem)
>> mock.__getitem__ = Mock(side_effect=setitem)

I think these are swapped; should be:

>> mock.__setitem__ = Mock(side_effect=setitem)
>> mock.__getitem__ = Mock(side_effect=getitem)

@chris-buccella chris-buccella mannequin added the docs Documentation in the Doc dir label Mar 17, 2014
@merwok
Copy link
Member

merwok commented Mar 17, 2014

Thanks, will fix.

@merwok merwok assigned merwok and unassigned docspython Mar 17, 2014
@python-dev
Copy link
Mannequin

python-dev mannequin commented Mar 17, 2014

New changeset e725de5a2760 by Éric Araujo in branch '3.4':
Fix typo in example (bpo-20963)
http://hg.python.org/cpython/rev/e725de5a2760

@merwok merwok closed this as completed Mar 17, 2014
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant