Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock: AssertExpectations - disable log output for "pass" #782

Closed
AntonStoeckl opened this issue Jul 10, 2019 · 1 comment · Fixed by #1360
Closed

mock: AssertExpectations - disable log output for "pass" #782

AntonStoeckl opened this issue Jul 10, 2019 · 1 comment · Fixed by #1360
Labels
bug pkg-mock Any issues related to Mock

Comments

@AntonStoeckl
Copy link

Currently there is no way to silence AssertExpectations if all expectations pass.
I find this output "PASS: ....." quite annoying and superfluous.
I assume most people are only interested in failures but don't need output of every passing assertion. It also seems inconsistent with other Assert... methods, which don't report success, only failure.

If this would be my userland code, I'd simply remove the log output for "PASS", but in a lib that's not good style.

I currently don't see a clean, backwards compatible way to optionally disable the logging for success cases. Maybe a new method like AssertFailedExpectations()?

@jcollum
Copy link

jcollum commented Sep 23, 2020

+1

there's a form for input on Testify v2 but really all I wanted to do was say "stop putting out so many lines of code for a passing test!" instead of filling out a questionnaire (with a lot of mandatory fields that I'm not interested in).

Just adding a boolean to AssertExpectations for "log all" or "log failing" would do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pkg-mock Any issues related to Mock
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants