@@ -246,15 +246,14 @@ def test_get_retry_logging(log_stream):
246
246
pytest .raises (UnavailableError , conn .make_call , "" )
247
247
stream .flush ()
248
248
log = stream .getvalue () # save as a local so can do pytest -l to see exact log
249
- assert log == """UMAPI timeout...service unavailable (code 429 on try 1)
250
- Next retry in 3 seconds...
251
- UMAPI timeout...service unavailable (code 429 on try 2)
252
- Next retry in 3 seconds...
253
- UMAPI timeout...service unavailable (code 429 on try 3)
249
+ assert log == """UMAPI request limit reached (code 429 on try 1)
250
+ waiting 3 seconds to continue ...
251
+ UMAPI request limit reached (code 429 on try 2)
252
+ waiting 3 seconds to continue ...
253
+ UMAPI request limit reached (code 429 on try 3)
254
254
UMAPI timeout...giving up after 3 attempts (6 seconds).
255
255
"""
256
256
257
-
258
257
# log_stream fixture defined in conftest.py
259
258
def test_post_retry_logging (log_stream ):
260
259
with mock .patch ("umapi_client.connection.requests.Session.post" ) as mock_post :
@@ -266,15 +265,14 @@ def test_post_retry_logging(log_stream):
266
265
pytest .raises (UnavailableError , conn .make_call , "" , [3 , 5 ])
267
266
stream .flush ()
268
267
log = stream .getvalue () # save as a local so can do pytest -l to see exact log
269
- assert log == """UMAPI timeout...service unavailable (code 429 on try 1)
270
- Next retry in 3 seconds...
271
- UMAPI timeout...service unavailable (code 429 on try 2)
272
- Next retry in 3 seconds...
273
- UMAPI timeout...service unavailable (code 429 on try 3)
268
+ assert log == """UMAPI request limit reached (code 429 on try 1)
269
+ waiting 3 seconds to continue ...
270
+ UMAPI request limit reached (code 429 on try 2)
271
+ waiting 3 seconds to continue ...
272
+ UMAPI request limit reached (code 429 on try 3)
274
273
UMAPI timeout...giving up after 3 attempts (6 seconds).
275
274
"""
276
275
277
-
278
276
def test_get_server_fail ():
279
277
with mock .patch ("umapi_client.connection.requests.Session.get" ) as mock_get :
280
278
mock_get .return_value = MockResponse (500 , text = "500 test server failure" )
0 commit comments