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 abcb5f9

Browse filesBrowse files
committed
Add test to reproduce #399
1 parent 78af0a9 commit abcb5f9
Copy full SHA for abcb5f9

File tree

Expand file treeCollapse file tree

1 file changed

+9
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-1
lines changed

‎pymysql/tests/test_connection.py

Copy file name to clipboardExpand all lines: pymysql/tests/test_connection.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def test_connection_gone_away(self):
418418
with self.assertRaises(pymysql.OperationalError) as cm:
419419
cur.execute("SELECT 1+1")
420420
# error occures while reading, not writing because of socket buffer.
421-
#self.assertEquals(cm.exception.args[0], 2006)
421+
#self.assertEqual(cm.exception.args[0], 2006)
422422
self.assertIn(cm.exception.args[0], (2006, 2013))
423423

424424
def test_init_command(self):
@@ -566,3 +566,11 @@ def test_previous_cursor_not_closed(self):
566566
cur2 = con.cursor()
567567
with self.assertRaises(pymysql.ProgrammingError):
568568
cur2.execute("SELECT 3")
569+
570+
def test_commit_during_multi_result(self):
571+
con = self.connections[0]
572+
cur = con.cursor()
573+
cur.execute("SELECT 1; SELECT 2")
574+
con.commit()
575+
cur.execute("SELECT 3")
576+
self.assertEqual(cur.fetchone()[0], 3)

0 commit comments

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