Skip to content

Commit 9a98b46

Browse files
committed
Debug token usage
1 parent edb8896 commit 9a98b46

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

tests/Pickle.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@
3535

3636

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

4346
def testPickleGithub(self):
4447
gh = github.Github(auth=self.auth)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ python =
1616

1717
[testenv]
1818
deps = -rrequirements/test.txt
19-
commands = pytest --cov=github --cov-report=xml {posargs}
19+
commands = pytest --capture tee-sys --cov=github --cov-report=xml {posargs}
2020

2121
[testenv:lint]
2222
basepython = python3.8

0 commit comments

Comments
 (0)