tests: GithubException now accepts also headers#1070
Merged
softwarefactory-project-zuul[bot] merged 1 commit intopackit:mainfrom Apr 28, 2021
Merged
tests: GithubException now accepts also headers#1070softwarefactory-project-zuul[bot] merged 1 commit intopackit:mainfrom
softwarefactory-project-zuul[bot] merged 1 commit intopackit:mainfrom
Conversation
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>
bc6c348 to
3189283
Compare
lachmanfrantisek
approved these changes
Apr 28, 2021
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" | ||
| ], |
Contributor
|
Build succeeded.
|
Contributor
|
Build succeeded (gate pipeline).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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