#NEWLINE# def test_max_pool_size_with_connection_failure( self ) : #NEWLINE# #INDENT# test_pool = Pool ( ( 'example.com' , 27017 ) , PoolOptions ( max_pool_size = 1 , connect_timeout = 1 , socket_timeout = 1 , wait_queue_timeout = 1 ) ) #NEWLINE# for i in range ( 2 ) : #NEWLINE# #INDENT# with self . assertRaises ( AutoReconnect ) as context : #NEWLINE# #INDENT# with test_pool . get_socket ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , checkout = True ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# self . assertNotIn ( 'waiting for socket from pool' , str ( context . exception ) )