Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail more gracefully when we hit API rate limit #20

Open
kdelee opened this issue Oct 17, 2018 · 0 comments
Open

Fail more gracefully when we hit API rate limit #20

kdelee opened this issue Oct 17, 2018 · 0 comments

Comments

@kdelee
Copy link
Collaborator

kdelee commented Oct 17, 2018

I saw a test failure that stemmed from this plugin hitting the API rate limit....the plugin should perhaps fail more gracefully or skip the test and raise a warning instead of just failing with a 403. Perhaps the warning could even point the user to the docs for the API limits on github.

Traceback (most recent call last):
  File "/root/.venv/lib/python2.7/site-packages/pytest_github/plugin.py", line 276, in pytest_runtest_setup
    if not issue.is_resolved:
  File "/root/.venv/lib/python2.7/site-packages/pytest_github/plugin.py", line 151, in is_resolved
    if not self.is_closed and not set(self._gh_plugin.completed_labels).intersection(self.labels):
  File "/root/.venv/lib/python2.7/site-packages/pytest_github/plugin.py", line 146, in labels
    return [l.name for l in labels]
  File "/root/.venv/lib/python2.7/site-packages/github3/structs.py", line 76, in __iter__
    json = self._get_json(response)
  File "/root/.venv/lib/python2.7/site-packages/github3/structs.py", line 111, in _get_json
    return self._json(response, 200)
  File "/root/.venv/lib/python2.7/site-packages/github3/models.py", line 156, in _json
    raise exceptions.error_for(response)
ForbiddenError: 403 API rate limit exceeded for user ID <secret>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant