-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Drop usage of overly broad mock.Mock() in tests. #3063
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
Conversation
| """ | ||
| channel = make_secure_channel( | ||
| client._connection.credentials, | ||
| client._credentials, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Should mocks like |
|
@daspecster All mocks should state their spec. Maybe we should even extend this to |
|
Apologies if you don't think unit tests are up to snuff, thank you for improving. I think a system test will inspire the most confidence in the functionality. When I first contributed the PR the API wasn't full fleshed out, but now that it is I can write one. |
This actually required a much more comprehensive set of unit test changes than expected. Also incorporated a change from googleapis#3057 (which slipped through due to overly broad mocks).
f4c9830 to
c8e8a49
Compare
|
Ahhh sorry I thought @daspecster had LGTM-ed! Eeek. Worth reverting or someone just take a look ex-post-merge-o? |
|
It's fine. :-) |
Drop usage of overly broad mock.Mock() in tests.
Drop usage of overly broad mock.Mock() in tests.

@lukesneeringer @tseaver any ideas on an easy "lint"-like check that will scream if people create a
Mock()without aspec?SIDEBAR: The error reporting unit tests are in a very bad state. This change opened my eyes to that fact, but I fear there is more hiding under the surface.