mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-14 18:12:35 +08:00
Remove automatic warning check (#296)
This commit is contained in:
@ -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):
|
||||
|
Reference in New Issue
Block a user