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

Typo in unittest.mock > Autospeccing documentation #71137

Closed
JoniBekenstein mannequin opened this issue May 4, 2016 · 3 comments
Closed

Typo in unittest.mock > Autospeccing documentation #71137

JoniBekenstein mannequin opened this issue May 4, 2016 · 3 comments
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@JoniBekenstein
Copy link
Mannequin

JoniBekenstein mannequin commented May 4, 2016

BPO 26950
Nosy @berkerpeksag

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 = None
closed_at = <Date 2016-05-04.13:51:54.710>
created_at = <Date 2016-05-04.13:45:42.238>
labels = ['type-feature', 'invalid', 'docs']
title = 'Typo in unittest.mock > Autospeccing documentation'
updated_at = <Date 2016-05-04.13:55:41.829>
user = 'https://bugs.python.org/JoniBekenstein'

bugs.python.org fields:

activity = <Date 2016-05-04.13:55:41.829>
actor = 'Joni Bekenstein'
assignee = 'docs@python'
closed = True
closed_date = <Date 2016-05-04.13:51:54.710>
closer = 'berker.peksag'
components = ['Documentation']
creation = <Date 2016-05-04.13:45:42.238>
creator = 'Joni Bekenstein'
dependencies = []
files = []
hgrepos = []
issue_num = 26950
keywords = []
message_count = 3.0
messages = ['264815', '264817', '264818']
nosy_count = 3.0
nosy_names = ['docs@python', 'berker.peksag', 'Joni Bekenstein']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue26950'
versions = []

@JoniBekenstein
Copy link
Mannequin Author

JoniBekenstein mannequin commented May 4, 2016

In several code examples from unittest.mock > Autospeccing documentation you will find "assret_called_with" instead of "assert_called_with".

@JoniBekenstein JoniBekenstein mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels May 4, 2016
@berkerpeksag
Copy link
Member

Thanks for the report, but the typos are intentional. Quoting from the documentation:

[...] if you misspell one of these assert methods then your assertion is gone:

>>> mock = Mock(name='Thing', return_value=None)
>>> mock(1, 2, 3)
>>> mock.assret_called_once_with(4, 5, 6)

Your tests can pass silently and incorrectly because of the typo.

@JoniBekenstein
Copy link
Mannequin Author

JoniBekenstein mannequin commented May 4, 2016

My bad, didn't see the notice! Makes sense though. Sorry for opening an issue.

@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 type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant