Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 11febbd

Browse filesBrowse files
committed
Merge pull request PyMySQL#87 from scop/assertequal
Use assertEqual instead of deprecated assertEquals
2 parents 42c2b22 + 6079889 commit 11febbd
Copy full SHA for 11febbd

File tree

Expand file treeCollapse file tree

4 files changed

+10
-10
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+10
-10
lines changed

‎tests/capabilities.py

Copy file name to clipboardExpand all lines: tests/capabilities.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ def check_data_integrity(self, columndefs, generator):
9191
# verify
9292
self.cursor.execute('select * from %s' % self.table)
9393
l = self.cursor.fetchall()
94-
self.assertEquals(len(l), self.rows)
94+
self.assertEqual(len(l), self.rows)
9595
try:
9696
for i in range(self.rows):
9797
for j in range(len(columndefs)):
98-
self.assertEquals(l[i][j], generator(i,j))
98+
self.assertEqual(l[i][j], generator(i,j))
9999
finally:
100100
if not self.debug:
101101
self.cursor.execute('drop table %s' % (self.table))
@@ -116,10 +116,10 @@ def generator(row, col):
116116
self.connection.commit()
117117
self.cursor.execute('select * from %s' % self.table)
118118
l = self.cursor.fetchall()
119-
self.assertEquals(len(l), self.rows)
119+
self.assertEqual(len(l), self.rows)
120120
for i in range(self.rows):
121121
for j in range(len(columndefs)):
122-
self.assertEquals(l[i][j], generator(i,j))
122+
self.assertEqual(l[i][j], generator(i,j))
123123
delete_statement = 'delete from %s where col1=%%s' % self.table
124124
self.cursor.execute(delete_statement, (0,))
125125
self.cursor.execute('select col1 from %s where col1=%s' % \

‎tests/test_MySQLdb_capabilities.py

Copy file name to clipboardExpand all lines: tests/test_MySQLdb_capabilities.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def test_stored_procedures(self):
5656

5757
c.callproc('test_sp', ('larch',))
5858
rows = c.fetchall()
59-
self.assertEquals(len(rows), 1)
60-
self.assertEquals(rows[0][0], 3)
59+
self.assertEqual(len(rows), 1)
60+
self.assertEqual(rows[0][0], 3)
6161
c.nextset()
6262

6363
c.execute("DROP PROCEDURE test_sp")

‎tests/test_MySQLdb_dbapi20.py

Copy file name to clipboardExpand all lines: tests/test_MySQLdb_dbapi20.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ def test_nextset(self):
189189
s=cur.nextset()
190190
if s:
191191
empty = cur.fetchall()
192-
self.assertEquals(len(empty), 0,
193-
"non-empty result set after other result sets")
192+
self.assertEqual(len(empty), 0,
193+
"non-empty result set after other result sets")
194194
#warn("Incompatibility: MySQL returns an empty result set for the CALL itself",
195195
# Warning)
196196
#assert s == None,'No more return sets, should return None'

‎tests/test_MySQLdb_nonstandard.py

Copy file name to clipboardExpand all lines: tests/test_MySQLdb_nonstandard.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def test_thread_id(self):
6767
"thread_id shouldn't accept arguments.")
6868

6969
def test_affected_rows(self):
70-
self.assertEquals(self.conn.affected_rows(), 0,
71-
"Should return 0 before we do anything.")
70+
self.assertEqual(self.conn.affected_rows(), 0,
71+
"Should return 0 before we do anything.")
7272

7373

7474
#def test_debug(self):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.