Skip to content

Commit e435601

Browse files
authored
Merge pull request #3926 from zhsj/bpo-3744
[release/1.3 backport] Move flag.Parse in tests to TestMain
2 parents a242695 + 2a38589 commit e435601

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func init() {
5454
flag.StringVar(&address, "address", defaultAddress, "The address to the containerd socket for use in the tests")
5555
flag.BoolVar(&noDaemon, "no-daemon", false, "Do not start a dedicated daemon for the tests")
5656
flag.BoolVar(&noCriu, "no-criu", false, "Do not run the checkpoint tests")
57-
flag.Parse()
5857
}
5958

6059
func testContext(t testing.TB) (context.Context, context.CancelFunc) {
@@ -67,6 +66,7 @@ func testContext(t testing.TB) (context.Context, context.CancelFunc) {
6766
}
6867

6968
func TestMain(m *testing.M) {
69+
flag.Parse()
7070
if testing.Short() {
7171
os.Exit(m.Run())
7272
}

0 commit comments

Comments
 (0)