From 1eb45bfab7bec720ad9ac48e79ca9ad67e1fecd9 Mon Sep 17 00:00:00 2001 From: mf2199 <38331387+mf2199@users.noreply.github.com> Date: Tue, 31 Mar 2020 15:10:59 -0400 Subject: [PATCH 1/3] Retry._deadline exposed as a property --- google/api_core/retry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/google/api_core/retry.py b/google/api_core/retry.py index a1d1f182..446d43c0 100644 --- a/google/api_core/retry.py +++ b/google/api_core/retry.py @@ -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. From 18c7f3c7315bcca53efb14915f1edddb4f47c083 Mon Sep 17 00:00:00 2001 From: mf2199 <38331387+mf2199@users.noreply.github.com> Date: Tue, 31 Mar 2020 15:10:59 -0400 Subject: [PATCH 2/3] feat Retry._deadline exposed as a property --- google/api_core/retry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/google/api_core/retry.py b/google/api_core/retry.py index a1d1f182..446d43c0 100644 --- a/google/api_core/retry.py +++ b/google/api_core/retry.py @@ -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. From fe5bcae10fa1d71056adb29f5109499db16bd27a Mon Sep 17 00:00:00 2001 From: mf2199 <38331387+mf2199@users.noreply.github.com> Date: Tue, 31 Mar 2020 17:26:09 -0400 Subject: [PATCH 3/3] added property test --- tests/unit/test_retry.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/test_retry.py b/tests/unit/test_retry.py index be0c6880..a0160e90 100644 --- a/tests/unit/test_retry.py +++ b/tests/unit/test_retry.py @@ -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()