diff --git a/HACKING.rst b/HACKING.rst index 19b0098170c..da137db0eee 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -26,6 +26,8 @@ Below you can find a list of checks specific to this repository. - [N343] Production code must not import from neutron.tests.* - [N344] Python 3: Do not use filter(lambda obj: test(obj), data). Replace it with [obj for obj in data if test(obj)]. +- [N346] Use neutron_lib.db.api.sqla_listen rather than sqlalchemy +- [N347] Test code must not import mock library .. note:: When adding a new hacking check to this repository or ``neutron-lib``, make diff --git a/lower-constraints.txt b/lower-constraints.txt index b436a88f511..0672190c3f9 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -44,7 +44,6 @@ logilab-common==1.4.1 logutils==0.3.5 Mako==0.4.0 MarkupSafe==1.0 -mock==3.0.0 monotonic==0.6;python_version<'3.3' mox3==0.20.0 msgpack-python==0.4.0 diff --git a/neutron/tests/unit/common/ovn/test_utils.py b/neutron/tests/unit/common/ovn/test_utils.py index e2bcd6cd137..489a388842b 100644 --- a/neutron/tests/unit/common/ovn/test_utils.py +++ b/neutron/tests/unit/common/ovn/test_utils.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + import fixtures -import mock from neutron_lib.api.definitions import extra_dhcp_opt as edo_ext from neutron.common.ovn import constants diff --git a/tox.ini b/tox.ini index cfe56460b78..0a78657937f 100644 --- a/tox.ini +++ b/tox.ini @@ -172,8 +172,17 @@ import-order-style = pep8 [flake8:local-plugins] extension = # Checks specific to neutron repo + N322 = neutron.hacking.checks:check_assert_called_once_with + N328 = neutron.hacking.checks:check_asserttruefalse + N330 = neutron.hacking.checks:check_assertempty + N331 = neutron.hacking.checks:check_assertisinstance + N332 = neutron.hacking.checks:check_assertequal_for_httpcode N340 = neutron.hacking.checks:check_oslo_i18n_wrapper N341 = neutron.hacking.checks:check_builtins_gettext + N343 = neutron.hacking.checks:check_no_imports_from_tests + N344 = neutron.hacking.checks:check_python3_no_filter + N346 = neutron.hacking.checks:check_no_sqlalchemy_event_import + N347 = neutron.hacking.checks:check_no_import_mock # Checks from neutron-lib N521 = neutron_lib.hacking.checks:use_jsonutils N524 = neutron_lib.hacking.checks:check_no_contextlib_nested