Merge pull request #1360 from hikyaru-suzuki/feature/update_logging_output

mock: AssertExpectations log reason only on failure
pull/1219/merge
Olivier Mengué 2023-07-29 05:52:15 +02:00 committed by GitHub
commit 862e41010c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -606,9 +606,9 @@ func (m *Mock) AssertExpectations(t TestingT) bool {
satisfied, reason := m.checkExpectation(expectedCall)
if !satisfied {
failedExpectations++
}
t.Logf(reason)
}
}
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())