#NEWLINE# def _run_cmd( self , cmd , args = [ ] , allow_fail = True , cwd = None ) : #NEWLINE# #INDENT# 'Run a command in the root of the test working copy.\n\n        Runs a command, with the given argument list, in the root of the test\n        working copy--returns the stdout and stderr streams and the exit code\n        from the subprocess.\n\n        :param cwd: If falsy run within the test package dir, otherwise run\n            within the named path.\n        ' #NEWLINE# cwd = ( cwd or self . package_dir ) #NEWLINE# result = _run_cmd ( ( [ cmd ] + list ( args ) ) , cwd = cwd ) #NEWLINE# if ( result [ 2 ] and ( not allow_fail ) ) : #NEWLINE# #INDENT# raise Exception ( ( 'Command failed retcode=%s' % result [ 2 ] ) ) #NEWLINE# #UNINDENT# return result