diff --git a/ceilometer/hacking/checks.py b/ceilometer/hacking/checks.py index f092921883..daeeef65bc 100644 --- a/ceilometer/hacking/checks.py +++ b/ceilometer/hacking/checks.py @@ -38,7 +38,7 @@ def no_log_warn(logical_line): C301 """ if logical_line.startswith('LOG.warn('): - yield(0, 'C301 Use LOG.warning() rather than LOG.warn()') + yield (0, 'C301 Use LOG.warning() rather than LOG.warn()') @core.flake8ext @@ -52,5 +52,5 @@ def no_os_popen(logical_line): """ if 'os.popen(' in logical_line: - yield(0, 'C302 Deprecated library function os.popen(). ' - 'Replace it using subprocess module. ') + yield (0, 'C302 Deprecated library function os.popen(). ' + 'Replace it using subprocess module. ') diff --git a/ceilometer/tests/unit/polling/test_dynamic_pollster.py b/ceilometer/tests/unit/polling/test_dynamic_pollster.py index f85af7292e..15c590e828 100644 --- a/ceilometer/tests/unit/polling/test_dynamic_pollster.py +++ b/ceilometer/tests/unit/polling/test_dynamic_pollster.py @@ -1618,7 +1618,7 @@ class TestDynamicPollster(base.BaseTestCase): request_args = pollster.definitions.sample_gatherer\ .create_request_arguments(pollster.definitions.configurations) - self.assertTrue("headers" in request_args) + self.assertIn("headers", request_args) self.assertEqual(2, len(request_args["headers"])) self.assertEqual(['header1', 'header2'], @@ -1629,7 +1629,7 @@ class TestDynamicPollster(base.BaseTestCase): list(map(lambda h: list(h.values())[0], request_args["headers"]))) - self.assertTrue("authenticated" not in request_args) + self.assertNotIn("authenticated", request_args) def test_create_request_arguments_PollsterSampleGatherer(self): pollster_definition = copy.deepcopy( @@ -1644,8 +1644,8 @@ class TestDynamicPollster(base.BaseTestCase): request_args = pollster.definitions.sample_gatherer\ .create_request_arguments(pollster.definitions.configurations) - self.assertTrue("headers" in request_args) - self.assertTrue("authenticated" in request_args) + self.assertIn("headers", request_args) + self.assertIn("authenticated", request_args) self.assertTrue(request_args["authenticated"]) self.assertEqual(3, len(request_args["headers"])) @@ -1667,8 +1667,8 @@ class TestDynamicPollster(base.BaseTestCase): pollster.definitions.sample_gatherer.create_request_arguments( pollster.definitions.configurations) - self.assertTrue("headers" not in request_args) - self.assertTrue("authenticated" in request_args) + self.assertNotIn("headers", request_args) + self.assertIn("authenticated", request_args) self.assertTrue(request_args["authenticated"]) @mock.patch('keystoneclient.v2_0.client.Client') diff --git a/tox.ini b/tox.ini index 12137fc3b8..e0f47ba9bb 100644 --- a/tox.ini +++ b/tox.ini @@ -33,8 +33,9 @@ commands = coverage xml -o cover/coverage.xml [testenv:pep8] -deps = hacking>=3.0.1,<=3.1.0 - doc8 +deps = + hacking>=6.1.0,<6.2.0 + doc8 commands = flake8 doc8 {posargs}