Skip to content

Commit 77fb9d2

Browse files
committed
Update unit test for new pygithub API
A change to the API caused the test to fail: ``` > mocker.patch.object(Github, "get_repo", side_effect=github.UnknownObjectException(status=42, data="foo")) E TypeError: __init__() missing 1 required positional argument: 'headers' ```
1 parent 292aa32 commit 77fb9d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compilesketches/tests/test_compilesketches.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ def get_pull(self, number):
352352
github_api_object.get_repo.assert_called_once_with(full_name_or_id=os.environ["GITHUB_REPOSITORY"])
353353
github_api_object.get_pull.assert_called_once_with(number=42) # PR number is hardcoded into test file
354354

355-
mocker.patch.object(Github, "get_repo", side_effect=github.UnknownObjectException(status=42, data="foo"))
355+
mocker.patch.object(Github,
356+
"get_repo",
357+
side_effect=github.UnknownObjectException(status=42, data="foo", headers=None))
356358
with pytest.raises(expected_exception=SystemExit, match="1"):
357359
compile_sketches.get_pull_request_base_ref()
358360

0 commit comments

Comments
 (0)