Make TestFlags less verbose

This commit is contained in:
Alexander Neumann 2017-05-16 20:49:18 +02:00
parent 2fa1238b8a
commit 8b461a7456
1 changed files with 2 additions and 0 deletions

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