Skip to content

Commit

Permalink
[CodeStyle][UP005] remove deprecated unittest alias (#51834)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ainavo authored Mar 21, 2023
1 parent e0eb5cf commit f3ef748
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ select = [
"UP001",
"UP003",
"UP004",
"UP005",
"UP007",
"UP008",
"UP010",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/tests/unittests/test_dot_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f3ef748

Please sign in to comment.