Browse Source

Enable some off-by-default checks

Some of the available checks are disabled by default, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None

Change-Id: Ice7b791bf308ce9da047e2205a990b8d97924bd9
changes/83/629183/1
zhanghongtao 4 years ago
committed by Hongtao Zhang
parent
commit
0ebe4ed7c0
3 changed files with 6 additions and 4 deletions
  1. +1
    -1
      sahara/tests/unit/plugins/vanilla/hadoop2/test_config_helper.py
  2. +1
    -1
      sahara/tests/unit/plugins/vanilla/v2_7_1/test_versionhandler.py
  3. +4
    -2
      tox.ini

+ 1
- 1
sahara/tests/unit/plugins/vanilla/hadoop2/test_config_helper.py View File

@ -130,7 +130,7 @@ class TestConfigHelper(base.SaharaTestCase):
}
opt_name = 'tt'
default = c_helper._get_spark_opt_default(opt_name)
self.assertEqual(default, None)
self.assertIsNone(default)
opt_name = 'test_name'
default = c_helper._get_spark_opt_default(opt_name)


+ 1
- 1
sahara/tests/unit/plugins/vanilla/v2_7_1/test_versionhandler.py View File

@ -189,7 +189,7 @@ class VersionHandlerTest(base.SaharaTestCase):
def test_get_edp_engine(self, join, get_instance, get_plugin):
job_type = ''
ret = self.vh.get_edp_engine(self.cluster, job_type)
self.assertEqual(ret, None)
self.assertIsNone(ret)
job_type = 'Java'
ret = self.vh.get_edp_engine(self.cluster, job_type)


+ 4
- 2
tox.ini View File

@ -99,8 +99,10 @@ commands = bandit -c bandit.yaml -r sahara -n5 -p sahara_default -x tests
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools
# [H904] Delay string interpolations at logging calls.
enable-extensions=H904
# [H904] Delay string interpolations at logging calls
# [H106] Don’t put vim configuration in source files
# [H203] Use assertIs(Not)None to check for None.
enable-extensions=H904,H106,H203
[hacking]
import_exceptions = sahara.i18n


Loading…
Cancel
Save