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/3877/head
Chance Zibolski 7 years ago
parent ced20f6f4e
commit b9adc356e8

@ -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