mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 21:05:10 +00:00
Make TestFlags less verbose
This commit is contained in:
parent
2fa1238b8a
commit
8b461a7456
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user