MCPcopy
hub / github.com/stretchr/testify / TestSubtest

Method TestSubtest

suite/suite_test.go:247–266  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245}
246
247func (suite *SuiteTester) TestSubtest() {
248 suite.TestSubtestRunCount++
249
250 for _, t := range []struct {
251 testName string
252 }{
253 {"first"},
254 {"second"},
255 } {
256 suiteT := suite.T()
257 suite.Run(t.testName, func() {
258 // We should get a different *testing.T for subtests, so that
259 // go test recognizes them as proper subtests for output formatting
260 // and running individual subtests
261 subTestT := suite.T()
262 suite.NotEqual(subTestT, suiteT)
263 })
264 suite.Equal(suiteT, suite.T())
265 }
266}
267
268func (suite *SuiteTester) TearDownSubTest() {
269 suite.TearDownSubTestNames = append(suite.TearDownSubTestNames, suite.T().Name())

Callers

nothing calls this directly

Calls 4

TMethod · 0.65
RunMethod · 0.45
NotEqualMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected