Skip to content

Commit

Permalink
[BE] use self.assertEquals instead of str equality in test_zero1.py (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
janeyx99 authored Jul 27, 2023
1 parent d09cc69 commit 8ada333
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_zero1.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ def test_zero1(self):

opt1.step()
opt2.step()
assert str(opt1.state_dict()) == str(opt2.state_dict()['base'])
self.assertEquals(opt1.state_dict(), opt2.state_dict()['base'])

s1 = opt1.state_dict()
s2 = opt2.state_dict()
opt1.load_state_dict(s1)
opt2.load_state_dict(s2)
assert str(opt1.state_dict()) == str(opt2.state_dict()['base'])
self.assertEquals(opt1.state_dict(), opt2.state_dict()['base'])

# step still runnable
opt1.step()
opt2.step()
opt1.load_state_dict(s1)
opt2.load_state_dict(s2)
assert str(opt1.state_dict()) == str(opt2.state_dict()['base'])
self.assertEquals(opt1.state_dict(), opt2.state_dict()['base'])

# step still runnable
opt1.step()
Expand Down

0 comments on commit 8ada333

Please sign in to comment.