Correctly use subtests in helm template tests

The testing.T in the subtest wasn't being used, so subtests were
effectively not being used. Additionally, in case subtests run in
parallel, we assign tt := tt to fix closure captures on range variables,
since the variables produced by a range are re-used between iterations.
pull/4207/head
Chance Zibolski 8 years ago committed by Sebastien Plisson
parent 3f9c720fbe
commit a4c0dd04c4

@ -132,7 +132,8 @@ func TestTemplateCmd(t *testing.T) {
var buf bytes.Buffer
for _, tt := range tests {
t.Run(tt.name, func(T *testing.T) {
tt := tt
t.Run(tt.name, func(t *testing.T) {
// capture stdout
old := os.Stdout
r, w, _ := os.Pipe()

Loading…
Cancel
Save