#NEWLINE# def test_connection_gone_away( self ) : #NEWLINE# #INDENT# '\n        http://dev.mysql.com/doc/refman/5.0/en/gone-away.html\n        http://dev.mysql.com/doc/refman/5.0/en/error-messages-client.html#error_cr_server_gone_error\n        ' #NEWLINE# con = self . connections [ 0 ] #NEWLINE# cur = con . cursor ( ) #NEWLINE# cur . execute ( 'SET wait_timeout=1' ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# with self . assertRaises ( pymysql . OperationalError ) as cm : #NEWLINE# #INDENT# cur . execute ( 'SELECT 1+1' ) #NEWLINE# #UNINDENT# self . assertIn ( cm . exception . args [ 0 ] , ( 2006 , 2013 ) )