testing-cabal / mock

The Python mock library

Home Page:https://docs.python.org/dev/library/unittest.mock.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

should we mark as deprecated?

mcallaghan-bsm opened this issue · comments

Good day,

As per the documentation, for Python3.3 and above, this package is now part of the standard library and maintained in unittest.mock.

mock is now part of the Python standard library, available as unittest.mock in Python 3.3 onwards.

It can be a common mistake for developers to accidentally (or out of habit) to utilize mock.mock.MagicMock, rather than unittest.mock.MagicMock.

Wondering if it would be appropriate to deprecate this package at some point
https://www.python.org/dev/peps/pep-0004/

Of course, though, the package is still useful for Python2 or <Python3.3 ... so not sure how to handle that.

This package is a rolling backport, meaning you can get bugfixes and new functionality from the master branch of cpython without having to wait for that version of Python to be released and become stable and released on your platform.

Thanks @cjw296 for explaining. TIP/suggestion: maybe update the README to explain the purpose/value of the package (adjacent to the rolling backport note that exists already). i.e. why someone might want to use this instead of the built-in, and if there are any limitations/cons to consider

Pull requests always welcome!