python retry with tenacity, disable `wait` for unittest

后端 未结 4 1867
无人共我
无人共我 2021-01-17 16:57

I am using the tenacity library to use its @retry decorator.

I am using this to make a function which makes a HTTP-request \"repeat\" multiple times in

4条回答
  •  一生所求
    2021-01-17 17:48

    mock the base class wait func with:

    mock.patch('tenacity.BaseRetrying.wait', side_effect=lambda *args, **kwargs: 0)
    

    it always not wait

提交回复
热议问题