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 7a301a2

Browse filesBrowse files
committed
Exception raised from _mysql should be reraise as is.
1 parent 5abcad0 commit 7a301a2
Copy full SHA for 7a301a2

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+10
-1
lines changed

‎tests/test_MySQLdb_capabilities.py

Copy file name to clipboardExpand all lines: tests/test_MySQLdb_capabilities.py
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,16 @@ def test_bug_3514287(self):
9292

9393
def test_ping(self):
9494
self.connection.ping()
95-
95+
96+
def test_reraise_exception(self):
97+
c = self.cursor
98+
try:
99+
c.execute("SELECT x FROM not_existing_table")
100+
except MySQLdb.ProgrammingError as e:
101+
self.assertEqual(e.args[0], 1146)
102+
return
103+
self.fail("Should raise ProgrammingError")
104+
96105

97106
if __name__ == '__main__':
98107
if test_MySQLdb.leak_test:

0 commit comments

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