Skip to content

Commit

Permalink
Merge pull request #1070 from TomasTomecek/fix-test-reporting
Browse files Browse the repository at this point in the history
tests: GithubException now accepts also headers

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

Reviewed-by: None <None>
Reviewed-by: Laura Barcziová <None>
  • Loading branch information
softwarefactory-project-zuul[bot] committed Apr 28, 2021
2 parents 8660647 + 3189283 commit 055dfbd
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/unit/test_reporting.py
@@ -1,5 +1,6 @@
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
from inspect import signature

import github
import gitlab
Expand Down Expand Up @@ -170,7 +171,21 @@ def test_set_status_gitlab(
"We made it!",
"packit/pr-rpm-build",
"https://api.packit.dev/build/111/logs",
(github.GithubException, (None, None), dict()),
(
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"
],
dict(),
),
id="GitHub PR",
),
pytest.param(
Expand Down

0 comments on commit 055dfbd

Please sign in to comment.