Skip to content

Commit

Permalink
Merge pull request #87 from scop/assertequal
Browse files Browse the repository at this point in the history
Use assertEqual instead of deprecated assertEquals
  • Loading branch information
methane committed May 16, 2016
2 parents 42c2b22 + 6079889 commit 11febbd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions tests/capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ def check_data_integrity(self, columndefs, generator):
# verify
self.cursor.execute('select * from %s' % self.table)
l = self.cursor.fetchall()
self.assertEquals(len(l), self.rows)
self.assertEqual(len(l), self.rows)
try:
for i in range(self.rows):
for j in range(len(columndefs)):
self.assertEquals(l[i][j], generator(i,j))
self.assertEqual(l[i][j], generator(i,j))
finally:
if not self.debug:
self.cursor.execute('drop table %s' % (self.table))
Expand All @@ -116,10 +116,10 @@ def generator(row, col):
self.connection.commit()
self.cursor.execute('select * from %s' % self.table)
l = self.cursor.fetchall()
self.assertEquals(len(l), self.rows)
self.assertEqual(len(l), self.rows)
for i in range(self.rows):
for j in range(len(columndefs)):
self.assertEquals(l[i][j], generator(i,j))
self.assertEqual(l[i][j], generator(i,j))
delete_statement = 'delete from %s where col1=%%s' % self.table
self.cursor.execute(delete_statement, (0,))
self.cursor.execute('select col1 from %s where col1=%s' % \
Expand Down
4 changes: 2 additions & 2 deletions tests/test_MySQLdb_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def test_stored_procedures(self):

c.callproc('test_sp', ('larch',))
rows = c.fetchall()
self.assertEquals(len(rows), 1)
self.assertEquals(rows[0][0], 3)
self.assertEqual(len(rows), 1)
self.assertEqual(rows[0][0], 3)
c.nextset()

c.execute("DROP PROCEDURE test_sp")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_MySQLdb_dbapi20.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def test_nextset(self):
s=cur.nextset()
if s:
empty = cur.fetchall()
self.assertEquals(len(empty), 0,
"non-empty result set after other result sets")
self.assertEqual(len(empty), 0,
"non-empty result set after other result sets")
#warn("Incompatibility: MySQL returns an empty result set for the CALL itself",
# Warning)
#assert s == None,'No more return sets, should return None'
Expand Down
4 changes: 2 additions & 2 deletions tests/test_MySQLdb_nonstandard.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def test_thread_id(self):
"thread_id shouldn't accept arguments.")

def test_affected_rows(self):
self.assertEquals(self.conn.affected_rows(), 0,
"Should return 0 before we do anything.")
self.assertEqual(self.conn.affected_rows(), 0,
"Should return 0 before we do anything.")


#def test_debug(self):
Expand Down

0 comments on commit 11febbd

Please sign in to comment.