'Test warning propagation'

def test_issue_491(self):

    conn = pymysql.connect(charset='utf8', **self.databases[0])
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        warnings.simplefilter('error', category=pymysql.Warning)
        for cursor_class in (cursors.Cursor, cursors.SSCursor):
            c = conn.cursor(cursor_class)
            try:
                c.execute("SELECT    CAST('124b'    AS    SIGNED)")
                c.fetchall()
            except pymysql.Warning as e:
                self.assertEqual(len(e.args), 2)
                self.assertEqual(e.args[0], 1292)
                self.assertTrue(isinstance(e.args[1], text_type))
            else:
                self.fail('Should    raise    Warning')
            finally:
                c.close()
