#NEWLINE# def test_get_socket_and_exception( self ) : #NEWLINE# #INDENT# cx_pool = self . create_pool ( max_pool_size = 1 , wait_queue_timeout = 1 ) #NEWLINE# with self . assertRaises ( ZeroDivisionError ) : #NEWLINE# #INDENT# with cx_pool . get_socket ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) as sock_info : #NEWLINE# #INDENT# ( 1 / 0 ) #NEWLINE# #UNINDENT# #UNINDENT# with cx_pool . get_socket ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) as new_sock_info : #NEWLINE# #INDENT# self . assertEqual ( sock_info , new_sock_info ) #NEWLINE# #UNINDENT# self . assertEqual ( 1 , len ( cx_pool . sockets ) )