Skip to content
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

feat: [CBT-6 helper] Exposing Retry._deadline as a property #20

Merged
merged 7 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions google/api_core/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ def retry_wrapped_func(*args, **kwargs):

return retry_wrapped_func

@property
def deadline(self):
return self._deadline

def with_deadline(self, deadline):
"""Return a copy of this retry with the given deadline.
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def test_constructor_defaults(self):
assert retry_._multiplier == 2
assert retry_._deadline == 120
assert retry_._on_error is None
assert retry_.deadline == 120

def test_constructor_options(self):
_some_function = mock.Mock()
Expand Down