mirror of
https://github.com/stretchr/testify.git
synced 2025-07-11 04:58:05 +00:00
update: log reason output only if failed
This commit is contained in:
parent
f36bfe3c33
commit
75b9b6dfff
@ -598,9 +598,9 @@ func (m *Mock) AssertExpectations(t TestingT) bool {
|
|||||||
satisfied, reason := m.checkExpectation(expectedCall)
|
satisfied, reason := m.checkExpectation(expectedCall)
|
||||||
if !satisfied {
|
if !satisfied {
|
||||||
failedExpectations++
|
failedExpectations++
|
||||||
}
|
|
||||||
t.Logf(reason)
|
t.Logf(reason)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if failedExpectations != 0 {
|
if failedExpectations != 0 {
|
||||||
t.Errorf("FAIL: %d out of %d expectation(s) were met.\n\tThe code you are testing needs to make %d more call(s).\n\tat: %s", len(expectedCalls)-failedExpectations, len(expectedCalls), failedExpectations, assert.CallerInfo())
|
t.Errorf("FAIL: %d out of %d expectation(s) were met.\n\tThe code you are testing needs to make %d more call(s).\n\tat: %s", len(expectedCalls)-failedExpectations, len(expectedCalls), failedExpectations, assert.CallerInfo())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user