[Go] [[subtests]]
Control of [[Parallelism]]
Run a group of tests in parallel
func TestGroupedParallel(t *testing.T) {
for _, tc := range testCases {
tc := tc // capture range variable
t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
if got := foo(tc.in); got != tc.out {
t.Errorf("got %v; want %v", got, tc.out)
}
...
})
}
}Cleaning up after a group of parallel tests
Last updated