FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Convert tasks example to use logging for testability by andrewsg · Pull Request #1219 · GoogleCloudPlatform/python-docs-samples · GitHub

Convert tasks example to use logging for testability - #1219

Merged
andrewsg merged 2 commits into
GoogleCloudPlatform:masterfrom
andrewsg:tasks
Nov 15, 2017
Merged

Convert tasks example to use logging for testability#1219
andrewsg merged 2 commits into
GoogleCloudPlatform:masterfrom
andrewsg:tasks

Conversation

Copy link
Copy Markdown
Member

No description provided.

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL