#NEWLINE# def test_load_warnings( self ) : #NEWLINE# #INDENT# 'Test load local infile produces the appropriate warnings' #NEWLINE# conn = self . connections [ 0 ] #NEWLINE# c = conn . cursor ( ) #NEWLINE# c . execute ( 'CREATE TABLE test_load_local (a INTEGER, b INTEGER)' ) #NEWLINE# filename = os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , 'data' , 'load_local_warn_data.txt' ) #NEWLINE# try : #NEWLINE# #INDENT# with warnings . catch_warnings ( record = True ) as w : #NEWLINE# #INDENT# warnings . simplefilter ( 'always' ) #NEWLINE# c . execute ( ( "LOAD DATA LOCAL INFILE '{0}' INTO TABLE " + "test_load_local FIELDS TERMINATED BY ','" ) . format ( c ) ) #NEWLINE# self . assertEqual ( w [ 0 ] . category , Warning ) #NEWLINE# self . assertTrue ( ( 'Incorrect integer value' in str ( w [ ( - 1 ) ] . message ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# c . execute ( 'DROP TABLE test_load_local' )