def succ(cmd, check_stderr=True, stdout=None, stderr=None):
    '''
    Alias to run with check return code and stderr
    '''
    code, out, err = run(cmd)

    # Because we're raising error, sometimes we want to process stdout/stderr after catching error
    # so we're copying these outputs if required
    if stdout is not None:
        stdout[:] = out
    if stderr is not None:
        stderr[:] = err

    if code != 0:
        for l in out:
            print(l)
    assert code == 0, 'Return: {} {}\nStderr: {}'.format(code, cmd, err)
    if check_stderr:
        assert err == [], 'Error: {} {}'.format(err, code)
    return code, out, err
def succ ( cmd , check_stderr = True , stdout = None , stderr = None ) : code , out , err = run ( cmd ) if stdout is not None : stdout [ : ] = out if stderr is not None : stderr [ : ] = err if code != 0 : for l in out : print ( l ) assert code == 0 , 'Return: {} {}\nStderr: {}' . format ( code , cmd , err ) if check_stderr : assert err == [ ] , 'Error: {} {}' . format ( err , code ) return code , out , err
Alias to run with check return code and stderr