File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -213,17 +213,12 @@ def test_start_attempt_with_backoff_generator(self):
213213 If operation has a backoff generator, it should be used to attach backoff
214214 times to attempts
215215 """
216+ from google .cloud .bigtable .data ._helpers import BackoffGenerator
216217
217- def mock_generator ():
218- """
219- always send back what was sent in
220- """
221- sent = None
222- while True :
223- sent = yield sent
224-
225- metric = self ._make_one (mock .Mock ())
226- metric .backoff_generator = mock_generator ()
218+ generator = BackoffGenerator ()
219+ # pre-seed generator with exepcted values
220+ generator .history = list (range (10 ))
221+ metric = self ._make_one (mock .Mock (), backoff_generator = generator )
227222 # initialize generator
228223 next (metric .backoff_generator )
229224 metric .start_attempt ()
You can’t perform that action at this time.
0 commit comments