This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eppeters
Recipients docs@python, eppeters
Date 2021-03-04.16:43:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614876238.1.0.922616136062.issue43400@roundup.psfhosted.org>
In-reply-to
Content
The unittest.mock library is very useful and very powerful, but it is not "very easy to use." Docs are useful and important, or we wouldn't be here in a documentation issue.

I have watched several of the most experienced Python programmers I know struggle with various aspects of mock, including basic usage. I have sat with frustrated developers who have used mocking utilities in other languages but had little Python experience, and they were surprised by some mock behaviors and just couldn't get things "right" until they were helped by someone with all the tiny little healed-over cuts from lots of mock usage.

Again, mock is great, but maybe if I have these opinions, I should contribute to making mock more intuitive. That's true. For now, though, the documentation contains this little line in the opening paragraphs that is unnecessary and can only make new mock users feel bad about having trouble: "Mock is very easy to use and is designed for use with unittest."

I propose we remove the opinion "Mock is very easy to use" and change this line to "Mock is designed for use with unittest." The rest of the paragraph flows just fine without this:

"Mock is very easy to use and is designed for use with unittest. Mock is based on the ‘action -> assertion’ pattern instead of ‘record -> replay’ used by many mocking frameworks."
History
Date User Action Args
2021-03-04 16:43:58eppeterssetrecipients: + eppeters, docs@python
2021-03-04 16:43:58eppeterssetmessageid: <1614876238.1.0.922616136062.issue43400@roundup.psfhosted.org>
2021-03-04 16:43:58eppeterslinkissue43400 messages
2021-03-04 16:43:57eppeterscreate