Skip to content

Documentation on mocking ratelimit limits decorator #34

Description

@mcohoon

I've implemented rate limiting as documented in the readme:

@on_exception(expo, RateLimitException, max_tries=8)
@limits(calls=15, period=FIFTEEN_MINUTES)
def call_api(url):
    response = requests.get(url)
    ...

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions