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

Function failOnPanic

suite/suite.go:86–92  ·  view source on GitHub ↗
(t *testing.T, r interface{})

Source from the content-addressed store, hash-verified

84}
85
86func failOnPanic(t *testing.T, r interface{}) {
87 t.Helper()
88 if r != nil {
89 t.Errorf("test panicked: %v\n%s", r, debug.Stack())
90 t.FailNow()
91 }
92}
93
94// Run provides suite functionality around golang subtests. It should be
95// called in place of t.Run(name, func(t *testing.T)) in test suite code.

Callers 2

recoverAndFailOnPanicFunction · 0.85
RunFunction · 0.85

Calls 3

HelperMethod · 0.65
ErrorfMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected