Remove automatic warning check (#296)

This commit is contained in:
INADA Naoki
2018-12-04 21:54:14 +09:00
committed by GitHub
parent 16915a0353
commit 5af8ece7ac
2 changed files with 0 additions and 68 deletions

View File

@ -160,28 +160,6 @@ class test_MySQLdb(capabilities.DatabaseTest):
return
self.fail("Should raise ProgrammingError")
def test_warning_propagation(self):
with warnings.catch_warnings():
# Ignore all warnings other than MySQLdb generated ones
warnings.simplefilter("ignore")
warnings.simplefilter("error", category=MySQLdb.Warning)
# verify for both buffered and unbuffered cursor types
for cursor_class in (cursors.Cursor, cursors.SSCursor):
c = self.connection.cursor(cursor_class)
try:
c.execute("SELECT CAST('124b' AS SIGNED)")
c.fetchall()
except MySQLdb.Warning as e:
# Warnings should have errorcode and string message, just like exceptions
self.assertEqual(len(e.args), 2)
self.assertEqual(e.args[0], 1292)
self.assertTrue(isinstance(e.args[1], unicode))
else:
self.fail("Should raise Warning")
finally:
c.close()
def test_binary_prefix(self):
# verify prefix behaviour when enabled, disabled and for default (disabled)
for binary_prefix in (True, False, None):