TestSubParallel 通过把多个子测试放到一个组中并发执行,同时多个子测试可以共享setup和tear-down
(t *testing.T)
| 28 | |
| 29 | // TestSubParallel 通过把多个子测试放到一个组中并发执行,同时多个子测试可以共享setup和tear-down |
| 30 | func TestSubParallel(t *testing.T) { |
| 31 | // setup |
| 32 | t.Logf("Setup") |
| 33 | |
| 34 | t.Run("group", func(t *testing.T) { |
| 35 | t.Run("Test1", parallelTest1) |
| 36 | t.Run("Test2", parallelTest2) |
| 37 | t.Run("Test3", parallelTest3) |
| 38 | }) |
| 39 | |
| 40 | // tear down |
| 41 | t.Logf("teardown") |
| 42 | } |
nothing calls this directly
no outgoing calls
no test coverage detected