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

Method Assert

suite/suite.go:71–78  ·  view source on GitHub ↗

Assert returns an assert context for suite. Normally, you can call `suite.NoError(expected, actual)`, but for situations where the embedded methods are overridden (for example, you might want to override assert.Assertions with require.Assertions), this method is provided so you can call `suite.Asse

()

Source from the content-addressed store, hash-verified

69// assert.Assertions with require.Assertions), this method is provided so you
70// can call `suite.Assert().NoError()`.
71func (suite *Suite) Assert() *assert.Assertions {
72 suite.mu.Lock()
73 defer suite.mu.Unlock()
74 if suite.Assertions == nil {
75 panic("'Assert' must not be called before 'Run' or 'SetT'")
76 }
77 return suite.Assertions
78}
79
80func recoverAndFailOnPanic(t *testing.T) {
81 t.Helper()

Callers 2

TestSuiteGettersFunction · 0.45
TestUnInitializedSuitesFunction · 0.45

Calls

no outgoing calls

Tested by 2

TestSuiteGettersFunction · 0.36
TestUnInitializedSuitesFunction · 0.36