Summary
I'll quote the readme of the mock package:
mock is now part of the Python standard library, available as unittest.mock in Python 3.3 onwards.
This package contains a rolling backport of the standard library mock code compatible with Python 3.6 and up.
So replacing import mock with from unittest import mock is not equivalent given a code-base that's on an old-ish Python version but want to use new features of mock and therefore decides to use the stand-alone package. Arguably, such code-base should be disabling the lint, nonetheless does the fix cause a little mayhem first should the rule be enabled.
Summary
I'll quote the readme of the
mockpackage:So replacing
import mockwithfrom unittest import mockis not equivalent given a code-base that's on an old-ish Python version but want to use new features ofmockand therefore decides to use the stand-alone package. Arguably, such code-base should be disabling the lint, nonetheless does the fix cause a little mayhem first should the rule be enabled.