Exception raised from _mysql should be reraise as is.

This commit is contained in:
INADA Naoki
2014-09-09 22:18:39 +09:00
parent 5abcad013e
commit 7a301a2c45

View File

@ -92,7 +92,16 @@ class test_MySQLdb(capabilities.DatabaseTest):
def test_ping(self):
self.connection.ping()
def test_reraise_exception(self):
c = self.cursor
try:
c.execute("SELECT x FROM not_existing_table")
except MySQLdb.ProgrammingError as e:
self.assertEqual(e.args[0], 1146)
return
self.fail("Should raise ProgrammingError")
if __name__ == '__main__':
if test_MySQLdb.leak_test: