Skip to content

Commit

Permalink
feat: [CBT-6 helper] Exposing Retry._deadline as a property (#20)
Browse files Browse the repository at this point in the history
* Retry._deadline exposed as a property

* feat Retry._deadline exposed as a property

* added property test

Co-authored-by: q-logic <52290913+q-logic@users.noreply.github.com>
Co-authored-by: Christopher Wilcox <crwilcox@google.com>
  • Loading branch information
3 people committed May 28, 2020
1 parent e4eaec0 commit 7be1e59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions google/api_core/retry.py
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
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

0 comments on commit 7be1e59

Please sign in to comment.