Open mcohoon opened 5 years ago
Having an API to reset the rate limit would be enough for me, since I could call it in the unittest.
Hi @mcohoon @tom-james-watson I've implemented this in the PR #43 _Add resetratelimit method.
I spent a lot of time trying to workaround this, but it was just too difficult without being able to reset the limit.
In my test I used this along with fakesleep
and am able to test my function that is decorated with sleep_and_retry and limits
I've implemented rate limiting as documented in the readme:
But I would like a way to effectively turn off this rate-limiting while running tests. I've not found any concise examples on stackoverflow on how mock a decorator as such without re-importing the module, and I think this would be an ideal library to show how to mock out a decorator for testing. Would you be open to adding an example of how to do such a thing?