From b67f9c12989c4c411f9416a22e360e9df74231b2 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Fri, 22 Sep 2017 10:47:14 -0700 Subject: [PATCH] flake8: Enable some off-by-default checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable the following off-by-default checks: * [H204] Use assert(Not)Equal to check for equality. * [H205] Use assert(Greater|Less)(Equal) for comparison. * [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls Increase the version of hacking in test-requirements so that can use new off-by-default checks. No changes to code were required. Change-Id: I98aa484dc5414ee49c281dfd40e44b3c613d53e0 --- test-requirements.txt | 2 +- tox.ini | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 172cb5623..16d9a4e76 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking<0.13,>=0.12.0 # Apache-2.0 +hacking>=1.0.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 mock>=2.0.0 # BSD testtools>=1.4.0 # MIT diff --git a/tox.ini b/tox.ini index 5829b440a..d0f6e1a21 100644 --- a/tox.ini +++ b/tox.ini @@ -69,8 +69,11 @@ import-order-style = pep8 application-import-names = ironic_python_agent # [H106] Don't put vim configuration in source files. # [H203] Use assertIs(Not)None to check for None. +# [H204] Use assert(Not)Equal to check for equality. +# [H205] Use assert(Greater|Less)(Equal) for comparison. +# [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls # [H904] Delay string interpolations at logging calls. -enable-extensions=H106,H203,H904 +enable-extensions=H106,H203,H204,H205,H210,H904 [hacking] import_exceptions = ironic.openstack.common.gettextutils._,testtools.matchers