diff --git a/pyproject.toml b/pyproject.toml index 23578ea6c4d24b..9c213c1fd768f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ select = [ "UP001", "UP003", "UP004", + "UP005", "UP007", "UP010", "UP011", diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_ignore_module.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_ignore_module.py index d1ef9e0be23f6c..d4e17afad92b41 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_ignore_module.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_ignore_module.py @@ -25,7 +25,7 @@ class TestIgnoreModule(unittest.TestCase): def test_ignore_module(self): modules = [scipy, astor] ignore_module(modules) - self.assertEquals( + self.assertEqual( [scipy, astor], BUILTIN_LIKELY_MODULES[-2:], 'Failed to add modules that ignore transcription', diff --git a/python/paddle/fluid/tests/unittests/prim/test_comp_get_grad_op_desc_prim_disabled.py b/python/paddle/fluid/tests/unittests/prim/test_comp_get_grad_op_desc_prim_disabled.py index 9292a1c4276d6b..82963168bca557 100644 --- a/python/paddle/fluid/tests/unittests/prim/test_comp_get_grad_op_desc_prim_disabled.py +++ b/python/paddle/fluid/tests/unittests/prim/test_comp_get_grad_op_desc_prim_disabled.py @@ -68,7 +68,7 @@ def test_get_grad_op_desc(self): self.fwd, self.no_grad_var, self.grad_sub_block )[0] ) - self.assertEquals(actual, self.desired_ops) + self.assertEqual(actual, self.desired_ops) if __name__ == '__main__': diff --git a/python/paddle/fluid/tests/unittests/prim/test_comp_get_grad_op_desc_prim_enabled.py b/python/paddle/fluid/tests/unittests/prim/test_comp_get_grad_op_desc_prim_enabled.py index bea82fda78c835..d7f7e3e1723fa5 100644 --- a/python/paddle/fluid/tests/unittests/prim/test_comp_get_grad_op_desc_prim_enabled.py +++ b/python/paddle/fluid/tests/unittests/prim/test_comp_get_grad_op_desc_prim_enabled.py @@ -80,7 +80,7 @@ def test_get_grad_op_desc(self): self.fwd, self.no_grad_var, self.grad_sub_block )[0] ) - self.assertEquals(actual, self.desired_ops) + self.assertEqual(actual, self.desired_ops) core._set_prim_backward_enabled(False) diff --git a/python/paddle/fluid/tests/unittests/prim/test_comp_skip_op_set.py b/python/paddle/fluid/tests/unittests/prim/test_comp_skip_op_set.py index fb9ef81b081d9b..e5ac6069604000 100644 --- a/python/paddle/fluid/tests/unittests/prim/test_comp_skip_op_set.py +++ b/python/paddle/fluid/tests/unittests/prim/test_comp_skip_op_set.py @@ -59,7 +59,7 @@ def test_get_grad_op_desc_without_skip(self): self.fwd, self.no_grad_var, self.grad_sub_block )[0] ) - self.assertEquals(actual, self.desired_ops_no_skip) + self.assertEqual(actual, self.desired_ops_no_skip) core._set_prim_backward_enabled(False) def test_get_grad_op_desc_with_skip(self): @@ -72,7 +72,7 @@ def test_get_grad_op_desc_with_skip(self): )[0] ) core._remove_skip_comp_ops("tanh") - self.assertEquals(actual[0], self.desired_ops) + self.assertEqual(actual[0], self.desired_ops) core._set_prim_backward_enabled(False) diff --git a/python/paddle/fluid/tests/unittests/test_dot_op.py b/python/paddle/fluid/tests/unittests/test_dot_op.py index 6c0d0c73855189..1da42ab93e681e 100644 --- a/python/paddle/fluid/tests/unittests/test_dot_op.py +++ b/python/paddle/fluid/tests/unittests/test_dot_op.py @@ -100,7 +100,7 @@ def test_1d_input(self): np_out = np.dot(data, data) pd_out = paddle.dot(x, y) - self.assertEquals(np_out, pd_out) + self.assertEqual(np_out, pd_out) def test_2d_input(self): data = np.array([], dtype=np.float32)