#NEWLINE# @ istest #NEWLINE# def traps_sys_exit_when_checking_if_a_package_exists( self ) : #NEWLINE# #INDENT# def exit( * args , **kwargs ) : #NEWLINE# #INDENT# sys . exit ( 1 ) #NEWLINE# #UNINDENT# execute = MagicMock ( side_effect = execute ) #NEWLINE# with patch ( 'provy.core.roles.Role.execute' , execute ) : #NEWLINE# #INDENT# self . assertFalse ( self . role . package_exists ( 'phyton' ) )