#NEWLINE# def test_request_connection_error( self ) : #NEWLINE# #INDENT# class MyLocust ( HttpLocust ) : #NEWLINE# #INDENT# host = 'http://localhost:1' #NEWLINE# #UNINDENT# locust = MyLocust ( ) #NEWLINE# response = locust . client . get ( '/' , timeout = 0.1 ) #NEWLINE# self . assertEqual ( self . status_code , 0 ) #NEWLINE# self . assertEqual ( 1 , global_stats . get ( '/' , 'GET' ) . num_failures ) #NEWLINE# self . assertEqual ( 0 , global_stats . get ( '/' , 'GET' ) . num_requests )