fix: Avoid dirtying stdout/stderr in test (#3165)

* fix: Default all clitest commands to io.Discard stdout/err

* fix: Never write to stdout or stderr in tests
This commit is contained in:
Mathias Fredriksson
2022-07-25 16:55:53 +03:00
committed by GitHub
parent ad2b29a571
commit 233aa17848
4 changed files with 13 additions and 7 deletions

View File

@ -185,7 +185,7 @@ func TestPasswordTerminalState(t *testing.T) {
// connect the child process's stdio to the PTY directly, not via a pipe
cmd.Stdin = ptty.Input().Reader
cmd.Stdout = ptty.Output().Writer
cmd.Stderr = os.Stderr
cmd.Stderr = ptty.Output().Writer
err := cmd.Start()
require.NoError(t, err)
process := cmd.Process