Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle][UP005] remove deprecated unittest alias #51834

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
"UP010",
"UP011",
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