[New-bugs-announce] [issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

Eddie Peters report at bugs.python.org
Thu Mar 4 11:43:58 EST 2021


New submission from Eddie Peters <eddie at dinogalactic.com>:

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."

----------
assignee: docs at python
components: Documentation
messages: 388102
nosy: docs at python, eppeters
priority: normal
severity: normal
status: open
title: Remove "Mock is very easy to use" from unittest.mock documentation
type: enhancement
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43400>
_______________________________________


More information about the New-bugs-announce mailing list