add support for mocking stdout/stderr in tests

check if this restored stdout/stderr