Skip to content

Commit

Permalink
Debug token usage
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Jan 8, 2025
1 parent 61b6b08 commit 1af028b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions tests/Pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@


class Pickle(unittest.TestCase):
# this test cannot use the replay connections, but has to really connect to the Github API
# we use the token given via GITHUB_TOKEN environment to avoid rate limit issues
token = os.environ.get("GITHUB_TOKEN")
auth = github.Auth.Token(token=token) if token else None
@classmethod
def setUpClass(cls):
# this test cannot use the replay connections, but has to really connect to the Github API
# we use the token given via GITHUB_TOKEN environment to avoid rate limit issues
token = os.environ.get("GITHUB_TOKEN")
cls.auth = github.Auth.Token(token=token) if token else None
print(f"auth is {cls.auth}")

def testPickleGithub(self):
gh = github.Github(auth=self.auth)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ python =

[testenv]
deps = -rrequirements/test.txt
commands = pytest --cov=github --cov-report=xml {posargs}
commands = pytest --capture tee-sys --cov=github --cov-report=xml {posargs}
passenv = GITHUB_TOKEN

[testenv:lint]
Expand Down

0 comments on commit 1af028b

Please sign in to comment.