2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-31 16:10:49 +00:00

Make TestFlags less verbose

This commit is contained in:
Alexander Neumann 2017-05-16 20:49:18 +02:00
parent 2fa1238b8a
commit 8b461a7456

View File

@ -1,6 +1,7 @@
package main
import (
"io/ioutil"
"testing"
)
@ -13,6 +14,7 @@ func TestFlags(t *testing.T) {
for _, cmd := range cmdRoot.Commands() {
t.Run(cmd.Name(), func(t *testing.T) {
cmd.Flags().SetOutput(ioutil.Discard)
err := cmd.ParseFlags([]string{"--help"})
if err.Error() == "pflag: help requested" {
err = nil