-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Cloud Pub/Sub Quickstart V2 #2004
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
494d194
Quickstart V2
anguillanneuf d6f6ea4
Merge branch 'master' into cps_quickstart
anguillanneuf 5828619
Merge branch 'master' into cps_quickstart
anguillanneuf 92929c3
Merge remote-tracking branch 'origin' into cps_quickstart
anguillanneuf c3768c4
Adopts Kir's suggestions
anguillanneuf 1cdfb31
Merge branch 'cps_quickstart' of github.com:GoogleCloudPlatform/pytho…
anguillanneuf 233d188
Merge branch 'master' into cps_quickstart
anguillanneuf a1c303b
Adopted Tim's suggestions
anguillanneuf cb03cd1
proper resource deletion during teardown
anguillanneuf b39898d
Merge branch 'master' into cps_quickstart
anguillanneuf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
proper resource deletion during teardown
- Loading branch information
commit cb03cd1f0c4026621acd89ffb15113ee5464e62a
There are no files selected for viewing
This file contains 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
This file contains 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer using the
monkeypatch
fixture for pytest. It can clean up after your tests so that the sleep function is restored after the test is done.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need some help with this. In the meanwhile, since other tests are also written using
_make_sleep_patch
in the same repo, shall we start another PR just for this purpose?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the pattern I'm describing: https://stackoverflow.com/a/29110609/101923,
Now that I have a closer look,
mock.patch
does the same thing, but this still seems much more complicated than it needs to be.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried
monkeypatch
but it created an infinite loop.while True: time.sleep(60)
would calltime.sleep(10)
, which callstime.sleep(10)
and never reachesraise RuntimeError('sigil')
.