diff --git a/cli/command/volume/create_test.go b/cli/command/volume/create_test.go index f5c711bf88..a37f9655b1 100644 --- a/cli/command/volume/create_test.go +++ b/cli/command/volume/create_test.go @@ -50,6 +50,7 @@ func TestVolumeCreateErrors(t *testing.T) { cmd.Flags().Set(key, value) } cmd.SetOut(io.Discard) + cmd.SetErr(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/volume/inspect_test.go b/cli/command/volume/inspect_test.go index bf16437524..62c9c00aa8 100644 --- a/cli/command/volume/inspect_test.go +++ b/cli/command/volume/inspect_test.go @@ -62,6 +62,7 @@ func TestVolumeInspectErrors(t *testing.T) { cmd.Flags().Set(key, value) } cmd.SetOut(io.Discard) + cmd.SetErr(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/volume/list_test.go b/cli/command/volume/list_test.go index dbed5a1606..45bbc955e4 100644 --- a/cli/command/volume/list_test.go +++ b/cli/command/volume/list_test.go @@ -43,6 +43,7 @@ func TestVolumeListErrors(t *testing.T) { cmd.Flags().Set(key, value) } cmd.SetOut(io.Discard) + cmd.SetErr(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/volume/prune_test.go b/cli/command/volume/prune_test.go index 7cfbad66b3..1bcafd57c8 100644 --- a/cli/command/volume/prune_test.go +++ b/cli/command/volume/prune_test.go @@ -49,6 +49,7 @@ func TestVolumePruneErrors(t *testing.T) { cmd.Flags().Set(key, value) } cmd.SetOut(io.Discard) + cmd.SetErr(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } } diff --git a/cli/command/volume/remove_test.go b/cli/command/volume/remove_test.go index 6f617f9ce0..61ac03578b 100644 --- a/cli/command/volume/remove_test.go +++ b/cli/command/volume/remove_test.go @@ -33,6 +33,7 @@ func TestVolumeRemoveErrors(t *testing.T) { })) cmd.SetArgs(tc.args) cmd.SetOut(io.Discard) + cmd.SetErr(io.Discard) assert.ErrorContains(t, cmd.Execute(), tc.expectedError) } }