Skip to content

Commit 7a301a2

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

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/test_MySQLdb_capabilities.py

+10-1
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)