Skip to content

Conversation

andrewsg
Copy link
Member

No description provided.

@andrewsg andrewsg requested a review from theacodes November 14, 2017 23:08
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 14, 2017
@theacodes
Copy link
Contributor

We generally don't use logging in our samples, what about this makes the sample more testable?

@andrewsg
Copy link
Member Author

Previously we had print() which turned out to be hard to reliably mock in a way that works across Py2 and 3. Logging is easy to mock. Either way, the output goes to the same place; we need some sort of off-instance data storage to prove the task ran, and the logging console is the most convenient place without pulling in another dependency.

@andrewsg andrewsg merged commit 19788b0 into GoogleCloudPlatform:master Nov 15, 2017
arithmetic1728 pushed a commit to googleapis/python-tasks that referenced this pull request Sep 2, 2020
…CloudPlatform/python-docs-samples#1219) * Convert tasks example to use logging for testability * Use capsys to test tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

3 participants