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

tests: GithubException now accepts also headers #1070

Merged

Conversation

TomasTomecek
Copy link
Member

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

Copy link
Member

@lachmanfrantisek lachmanfrantisek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TomasTomecek TomasTomecek added mergeit When set, zuul wil gate and merge the PR. and removed mergeit When set, zuul wil gate and merge the PR. labels Apr 28, 2021
@softwarefactory-project-zuul
Copy link
Contributor

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>
Comment on lines +175 to +186
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"
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution!

Copy link
Member

@lbarcziova lbarcziova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@TomasTomecek TomasTomecek added the mergeit When set, zuul wil gate and merge the PR. label Apr 28, 2021
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit When set, zuul wil gate and merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants