refactor(redistest): simplify redistest.CreateRedis API (#3086)

This commit is contained in:
cong
2023-04-01 13:02:21 +08:00
committed by GitHub
parent 6a692453dc
commit b49fc81618
9 changed files with 72 additions and 156 deletions

View File

@@ -43,9 +43,7 @@ func TestAuthenticator(t *testing.T) {
},
}
store, clean, err := redistest.CreateRedis()
assert.Nil(t, err)
defer clean()
store := redistest.CreateRedis(t)
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {

View File

@@ -45,9 +45,7 @@ func TestStreamAuthorizeInterceptor(t *testing.T) {
},
}
store, clean, err := redistest.CreateRedis()
assert.Nil(t, err)
defer clean()
store := redistest.CreateRedis(t)
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
@@ -111,9 +109,7 @@ func TestUnaryAuthorizeInterceptor(t *testing.T) {
},
}
store, clean, err := redistest.CreateRedis()
assert.Nil(t, err)
defer clean()
store := redistest.CreateRedis(t)
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {