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

Method Test

mock/mock.go:345–349  ·  view source on GitHub ↗

* Setting expectations */ Test sets the [TestingT] on which errors will be reported, otherwise errors will cause a panic. Test should not be called on an object that is going to be used in a goroutine other than the one running the test function.

(t TestingT)

Source from the content-addressed store, hash-verified

343// Test should not be called on an object that is going to be used in a
344// goroutine other than the one running the test function.
345func (m *Mock) Test(t TestingT) {
346 m.mutex.Lock()
347 defer m.mutex.Unlock()
348 m.test = t
349}
350
351// fail fails the current test with the given formatted format and args.
352// In case that a test was defined, it uses the test APIs for failing a test,

Callers 1

TestMock_WithTestFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestMock_WithTestFunction · 0.36