-
Notifications
You must be signed in to change notification settings - Fork 48
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
tests: GithubException now accepts also headers #1070
tests: GithubException now accepts also headers #1070
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Build failed.
|
We need to update how we mock GithubException since 1.55 it now accepts HTTP headers in form of a positional argument as well: PyGithub/PyGithub#1887 This is implemented with inspect.signature so our tests work for both versions of pygithub <1.55 and >=1.55 because 1.55 is not in stable Fedora yet. Kudos @lbarcziova Signed-off-by: Tomas Tomecek <ttomecek@redhat.com> Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
bc6c348
to
3189283
Compare
github.GithubException, | ||
# https://docs.python.org/3/library/inspect.html#inspect.signature | ||
# to account for changes in positional arguments: pygithub 1.55 added headers | ||
# as additional positional argument; this creates an iterable and sets None | ||
# for every argument of GithubException.__init__ except for 'self' | ||
[ | ||
None | ||
for param_name, param in signature( | ||
github.GithubException.__init__ | ||
).parameters.items() | ||
if param_name != "self" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice solution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Build succeeded.
|
Build succeeded (gate pipeline).
|
We need to update how we mock GithubException since 1.55 it now accepts
HTTP headers in form of a positional argument as well:
PyGithub/PyGithub#1887
Kudos @lbarcziova