From 26f7523667c756caafb5a55cf0760af94ee93955 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Thu, 14 Sep 2017 12:16:27 -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 Update test-requirements.txt to use latest version of: * hacking Enable the following off-by-default checks: * [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. No code changes were required. Change-Id: I486551c0149acd1d066f7a1a8bad857e7b961b92 --- test-requirements.txt | 2 +- tox.ini | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 31d53a3f..c11b9f4d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # 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,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.0.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 python-subunit>=0.0.18 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index b1d9f856..693edabc 100644 --- a/tox.ini +++ b/tox.ini @@ -42,8 +42,12 @@ commands = oslo_debug_helper {posargs} # E123, E125 skipped as they are invalid PEP-8. show-source = True ignore = E123,E125 -# H106: Don’t put vim configuration in source files -# H203: Use assertIs(Not)None to check for None -enable-extensions=H106,H203 +# [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,H204,H205,H210,H904 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build