#NEWLINE# @ patch ( 'invoke.program.sys' ) #NEWLINE# def defaults_to_sys_argv( self , mock_sys ) : #NEWLINE# #INDENT# argv = [ 'inv' , '--version' ] #NEWLINE# mock_sys . argv = p #NEWLINE# p = Program ( ) #NEWLINE# p . print_version = Mock ( ) #NEWLINE# p . run ( exit = False ) #NEWLINE# p . print_version . assert_called ( )