Conversation
|
|
||
| # Make an authenticated API request | ||
| buckets = storage_client.buckets().list(project=project).execute() | ||
| print(buckets) |
There was a problem hiding this comment.
Normally I'd "from future import print_function" in a file that uses print(), even if this technically works in 2.7 as-is. Do we have an explicit policy on this?
There was a problem hiding this comment.
We don't, and generally because we use .format is isn't ever explicitly needed to use print_function.
There was a problem hiding this comment.
Okay, my preference is to include the import because print with parens is confusing syntax in Py2, but I'll leave it to you.
| import snippets | ||
|
|
||
|
|
||
| def test_implicit(): |
There was a problem hiding this comment.
I am confused about the structure of these tests; is there part of this (that does assertions etc) I'm missing?
There was a problem hiding this comment.
It's a system test, in this case an absence of an error is the assertion. We could technically capture the output and assert that it matches some idea of what we think the output should be, but it doesn't necessarily add any value.
|
|
||
| def implicit(): | ||
| import google.auth | ||
| from google.auth.transport import requests |
There was a problem hiding this comment.
Why do we do these imports inside the function? And why do we have a vendored requests version?
There was a problem hiding this comment.
Because when these are included in the documentation it will only include the body of this function.
There was a problem hiding this comment.
Okay, this strikes me as a bit confusing when you're reading the actual file, but not a big deal.
No description provided.