diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08aef91b2..9b908c6db 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: - id: flake8 name: flake8 additional_dependencies: - - hacking>=3.0.1,<3.1.0 + - hacking>=6.1.0,<6.2.0 language: python entry: flake8 files: '^.*\.py$' diff --git a/taskflow/jobs/backends/impl_zookeeper.py b/taskflow/jobs/backends/impl_zookeeper.py index 1e45f0f71..91156cd34 100644 --- a/taskflow/jobs/backends/impl_zookeeper.py +++ b/taskflow/jobs/backends/impl_zookeeper.py @@ -856,4 +856,4 @@ class ZookeeperJobBoard(base.NotifyingJobBoard): "Failed to do post-connection" " initialization", cause=exc) finally: - del(exc_type, exc, exc_tb) + del (exc_type, exc, exc_tb) diff --git a/taskflow/tests/unit/jobs/test_zk_job.py b/taskflow/tests/unit/jobs/test_zk_job.py index 23d05050d..39871b9d0 100644 --- a/taskflow/tests/unit/jobs/test_zk_job.py +++ b/taskflow/tests/unit/jobs/test_zk_job.py @@ -271,12 +271,12 @@ class ZakeJobboardTest(test.TestCase, ZookeeperBoardTestMixin): with base.connect_close(self.board): self.board.register_entity(entity_instance) # Check '.entity' node has been created - self.assertTrue(self.board.entity_path in self.client.storage.paths) + self.assertIn(self.board.entity_path, self.client.storage.paths) conductor_entity_path = k_paths.join(self.board.entity_path, 'conductor', conductor_name) - self.assertTrue(conductor_entity_path in self.client.storage.paths) + self.assertIn(conductor_entity_path, self.client.storage.paths) conductor_data = ( self.client.storage.paths[conductor_entity_path]['data']) self.assertTrue(len(conductor_data) > 0) diff --git a/taskflow/tests/unit/patterns/test_graph_flow.py b/taskflow/tests/unit/patterns/test_graph_flow.py index 0fa756019..5212d0637 100644 --- a/taskflow/tests/unit/patterns/test_graph_flow.py +++ b/taskflow/tests/unit/patterns/test_graph_flow.py @@ -239,7 +239,7 @@ class GraphFlowTest(test.TestCase): tasks = set([task1, task2, f1]) f = gf.Flow('test').add(task1, task2, f1) for (n, data) in f.iter_nodes(): - self.assertTrue(n in tasks) + self.assertIn(n, tasks) self.assertDictEqual({}, data) def test_iter_links(self): @@ -251,8 +251,8 @@ class GraphFlowTest(test.TestCase): tasks = set([task1, task2, f1]) f = gf.Flow('test').add(task1, task2, f1) for (u, v, data) in f.iter_links(): - self.assertTrue(u in tasks) - self.assertTrue(v in tasks) + self.assertIn(u, tasks) + self.assertIn(v, tasks) self.assertDictEqual({}, data) diff --git a/taskflow/tests/unit/patterns/test_linear_flow.py b/taskflow/tests/unit/patterns/test_linear_flow.py index 682467b35..d473fe3c9 100644 --- a/taskflow/tests/unit/patterns/test_linear_flow.py +++ b/taskflow/tests/unit/patterns/test_linear_flow.py @@ -130,7 +130,7 @@ class LinearFlowTest(test.TestCase): f = lf.Flow('test').add(task1, task2, task3) tasks = set([task1, task2, task3]) for (node, data) in f.iter_nodes(): - self.assertTrue(node in tasks) + self.assertIn(node, tasks) self.assertDictEqual({}, data) def test_iter_links(self): @@ -140,6 +140,6 @@ class LinearFlowTest(test.TestCase): f = lf.Flow('test').add(task1, task2, task3) tasks = set([task1, task2, task3]) for (u, v, data) in f.iter_links(): - self.assertTrue(u in tasks) - self.assertTrue(v in tasks) + self.assertIn(u, tasks) + self.assertIn(v, tasks) self.assertDictEqual({'invariant': True}, data) diff --git a/taskflow/tests/unit/patterns/test_unordered_flow.py b/taskflow/tests/unit/patterns/test_unordered_flow.py index c5929069e..144459160 100644 --- a/taskflow/tests/unit/patterns/test_unordered_flow.py +++ b/taskflow/tests/unit/patterns/test_unordered_flow.py @@ -126,7 +126,7 @@ class UnorderedFlowTest(test.TestCase): f = uf.Flow('test') f.add(task2, task1) for (node, data) in f.iter_nodes(): - self.assertTrue(node in tasks) + self.assertIn(node, tasks) self.assertDictEqual({}, data) def test_iter_links(self):