cyborg/cyborg/hacking
zhangbailin 59fc114d30 hacking: force explicit import of python's mock
Since we dropped support for python 2 [1], we no longer need to use the
mock library, which existed to backport py3 functionality into py2.
Which must be done by saying::

    from unittest import mock

...because if you say::

    import mock

...you definitely will not be getting the standard library mock.
That will always import the third party mock library.

This commit adds hacking check N366 to enforce the former.

This check can be removed in the future (and we can start saying
``import mock`` again) if we manage to purge these transitive
dependencies. I'm not holding my breath.

[1]https://review.opendev.org/#/c/688593/

Change-Id: I79b0a084b8a99c54ce175a520e039e5572c5165a
2020-06-19 09:33:13 +00:00
..
__init__.py Improve pep8 checking along with hacking 2018-08-16 17:22:33 +07:00
checks.py hacking: force explicit import of python's mock 2020-06-19 09:33:13 +00:00