'return a (res, out, err) tuple where
out and err represent the output/error output
during function execution.
call the given function with args/kwargs
and capture output/error during its execution.'

def call(cls, func, *args, **kwargs):

    so = cls()
    try:
        res = func(*args, **kwargs)
    finally:
        (out, err) = so.reset()
    return (res, out, err)
