You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ from deprecated import deprecated
45
45
@deprecated
46
46
defrate(self):
47
47
pass
48
-
48
+
49
49
@deprecated(reason="Deprecated in favor of the new branch protection")
50
50
defget_protected_branch(self):
51
51
pass
@@ -65,10 +65,13 @@ You will need a `GithubCredentials.py` file at the root of the project with the
65
65
login = "my_login"
66
66
password = "my_password"
67
67
oauth_token = "my_token" # Can be left empty if not used
68
+
jwt = "my_json_web_token" # Can be left empty if not used
68
69
```
69
70
70
71
If you use 2 factor authentication on your Github account, tests that require a login/password authentication will fail.
71
-
You can use `python -m github.tests Issue139.testCompletion --record --auth_with_token` to use the `oauth_token` field specified in `GithubCredentials.py` when recording a unit test interaction. Note that the `password = ""` (empty string is ok) must still be present in `GithubCredentials.py` to run the tests even when the `--auth_with_token` arg is used. (Also note that if you record your test data with `--auth_with_token` then you also need to be in token authentication mode when running the test. A simple alternative it to replace `token private_token_removed` with `Basic login_and_password_removed` in all your newly generated ReplayData files.)
72
+
You can use `python -m github.tests Issue139.testCompletion --record --auth_with_token` to use the `oauth_token` field specified in `GithubCredentials.py` when recording a unit test interaction. Note that the `password = ""` (empty string is ok) must still be present in `GithubCredentials.py` to run the tests even when the `--auth_with_token` arg is used. (Also note that if you record your test data with `--auth_with_token` then you also need to be in token authentication mode when running the test. A simple alternative is to replace `token private_token_removed` with `Basic login_and_password_removed` in all your newly generated ReplayData files.)
73
+
74
+
Similarly, you can use `python -m github.tests Issue139.testCompletion --record --auth_with_jwt` to use the `jwt` field specified in `GithubCredentials.py` to access endpoints that require JWT.
72
75
73
76
To run manual tests with external scripts that use the PyGithub package, you can install your development version with:
else: # pragma no cover (Cannot happen, but could if we add an authentication method => be prepared)
473
477
requestHeaders["Authorization"] ="(unknown auth removed)"# pragma no cover (Cannot happen, but could if we add an authentication method => be prepared)
0 commit comments