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

Fix compatibility with PyGithub >= 1.55 #4440

Merged
merged 4 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changes/pr4440.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

fix:
- "Fix compatibility with PyGithub >= 1.55 - [#4440](https://github.com/PrefectHQ/prefect/pull/4440)"
2 changes: 1 addition & 1 deletion tests/core/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def clear_context_cache():


class TestCreateFlow:
""" Test various Flow constructors """
"""Test various Flow constructors"""

def test_create_flow_with_no_args(self):
# name is required
Expand Down
12 changes: 9 additions & 3 deletions tests/storage/test_github_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def test_get_flow(github_client, ref, caplog):


def test_get_flow_missing_repo(github_client, caplog):
github_client.get_repo.side_effect = github.UnknownObjectException(404, {})
github_client.get_repo.side_effect = github.UnknownObjectException(
status=404, data={}, headers={}
)

storage = GitHub(repo="test/repo", path="flow.py")
storage.add_flow(Flow("test"))
Expand All @@ -153,7 +155,9 @@ def test_get_flow_missing_repo(github_client, caplog):
@pytest.mark.parametrize("ref", [None, "myref"])
def test_get_flow_missing_ref(github_client, ref, caplog):
repo = github_client.get_repo.return_value
repo.get_commit.side_effect = github.UnknownObjectException(404, {})
repo.get_commit.side_effect = github.UnknownObjectException(
status=404, data={}, headers={}
)

storage = GitHub(repo="test/repo", path="flow.py", ref=ref)
storage.add_flow(Flow("test"))
Expand All @@ -169,7 +173,9 @@ def test_get_flow_missing_ref(github_client, ref, caplog):
@pytest.mark.parametrize("ref", [None, "myref"])
def test_get_flow_missing_file(github_client, ref, caplog):
repo = github_client.get_repo.return_value
repo.get_contents.side_effect = github.UnknownObjectException(404, {})
repo.get_contents.side_effect = github.UnknownObjectException(
status=404, data={}, headers={}
)

storage = GitHub(repo="test/repo", path="flow.py", ref=ref)
storage.add_flow(Flow("test"))
Expand Down
4 changes: 2 additions & 2 deletions tests/tasks/aws/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_raises_on_invalid_compression_method(self, mocked_boto_client):
task.run("key", compression="gz_fake")

def test_boto3_client_is_created_with_session(self, mocked_boto_client):
""" Tests the fix for #3925 """
"""Tests the fix for #3925"""
task = S3Download("test")
task.run("key")
assert (
Expand Down Expand Up @@ -114,7 +114,7 @@ def test_raises_on_invalid_compression_method(self, mocked_boto_client):
task.run(b"data", compression="gz_fake")

def test_boto3_client_is_created_with_session(self, mocked_boto_client):
""" Tests the fix for #3925 """
"""Tests the fix for #3925"""
task = S3Upload("test")
task.run("key")
assert (
Expand Down