From 20c23d8ccbdf14d2d97b039d6a8cca62f4b04873 Mon Sep 17 00:00:00 2001 From: blue55 Date: Thu, 22 Jun 2017 14:51:37 +0800 Subject: [PATCH] Enable some off-by-default checks Some of the available checks are disabled by default, like: [H203] Use assertIs(Not)None to check for None Change-Id: I59dafb62cedc5217b6e5eb6efb997a9ee3c29bbb --- openstackclient/tests/functional/volume/v1/test_service.py | 5 +---- openstackclient/tests/functional/volume/v2/test_service.py | 3 +-- tox.ini | 2 ++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/openstackclient/tests/functional/volume/v1/test_service.py b/openstackclient/tests/functional/volume/v1/test_service.py index c921c46aaa..fee73f189c 100644 --- a/openstackclient/tests/functional/volume/v1/test_service.py +++ b/openstackclient/tests/functional/volume/v1/test_service.py @@ -64,10 +64,7 @@ class VolumeServiceTests(common.BaseVolumeTests): 'enabled', cmd_output[0]['Status'] ) - self.assertEqual( - None, - cmd_output[0]['Disabled Reason'] - ) + self.assertIsNone(cmd_output[0]['Disabled Reason']) # Test volume service set --disable and --disable-reason disable_reason = 'disable_reason' diff --git a/openstackclient/tests/functional/volume/v2/test_service.py b/openstackclient/tests/functional/volume/v2/test_service.py index 8d1944e404..6986fde69b 100644 --- a/openstackclient/tests/functional/volume/v2/test_service.py +++ b/openstackclient/tests/functional/volume/v2/test_service.py @@ -64,8 +64,7 @@ class VolumeServiceTests(common.BaseVolumeTests): 'enabled', cmd_output[0]['Status'] ) - self.assertEqual( - None, + self.assertIsNone( cmd_output[0]['Disabled Reason'] ) diff --git a/tox.ini b/tox.ini index ac5c6593fe..0f22650a9a 100644 --- a/tox.ini +++ b/tox.ini @@ -85,6 +85,8 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen [flake8] show-source = True +# H203: Use assertIs(Not)None to check for None +enable-extensions = H203 exclude = .git,.tox,dist,doc,*lib/python*,*egg,build,tools # If 'ignore' is not set there are default errors and warnings that are set # Doc: http://flake8.readthedocs.org/en/latest/config.html#default