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

Method fail

mock/mock.go:354–363  ·  view source on GitHub ↗

fail fails the current test with the given formatted format and args. In case that a test was defined, it uses the test APIs for failing a test, otherwise it uses panic.

(format string, args ...interface{})

Source from the content-addressed store, hash-verified

352// In case that a test was defined, it uses the test APIs for failing a test,
353// otherwise it uses panic.
354func (m *Mock) fail(format string, args ...interface{}) {
355 m.mutex.Lock()
356 defer m.mutex.Unlock()
357
358 if m.test == nil {
359 panic(fmt.Sprintf(format, args...))
360 }
361 m.test.Errorf(format, args...)
362 m.test.FailNow()
363}
364
365// On starts a description of an expectation of the specified method
366// being called.

Callers 2

MethodCalledMethod · 0.95
UnsetMethod · 0.45

Calls 2

ErrorfMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected