#NEWLINE# def test_assert_original_traceback_maintained( self ) : #NEWLINE# #INDENT# def bar( self ) : #NEWLINE# #INDENT# foo = 'foofoo' #NEWLINE# raise os_win_exc . HyperVVMNotFoundException ( vm_name = foo ) #NEWLINE# #UNINDENT# self . driver . _vmops . get_info . side_effect = bar #NEWLINE# try : #NEWLINE# #INDENT# self . driver . get_info ( mock . sentinel . instance ) #NEWLINE# self . fail ( 'Test expected exception, but it was not raised.' ) #NEWLINE# #UNINDENT# except exception . InstanceNotFound : #NEWLINE# #INDENT# ( _ , _ , trace ) = sys . exc_info ( ) #NEWLINE# while trace . tb_next : #NEWLINE# #INDENT# trace = trace . tb_next #NEWLINE# #UNINDENT# self . assertEqual ( 'foofoo' , trace . tb_frame . f_locals [ 'foo' ] )