Skip to content

Commit

Permalink
fixed github client failure in GitHub API
Browse files Browse the repository at this point in the history
  • Loading branch information
mraarif authored Oct 27, 2020
2 parents 38a6064 + 641ff2f commit acdd1de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pytest_repo_health/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""


__version__ = "2.0.2"
__version__ = "2.0.3"


def health_metadata(parent_path, output_keys):
Expand Down
2 changes: 1 addition & 1 deletion pytest_repo_health/fixtures/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def github_repo(git_origin_url, github_client, loop): # pylint: disable=r
return GitHubClient(None, github_client.message)

try:
return GitHubClient(await github_client.fetch_repository(org_name, repo_name), None)
return GitHubClient(await github_client.object.fetch_repository(org_name, repo_name), None)
except GitHubError as e:
error_message = 'An error occurred while fetching the repository. GitHub API threw an error, "{0}"'.format(e)
logger.error(error_message, exc_info=e)
Expand Down
6 changes: 4 additions & 2 deletions tests/test_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ def check_git_origin_url(git_origin_url):
import pytest
def check_github_client(github_client):
assert github_client is not None
assert github_client.message is None
assert github_client.object is not None
async def check_github_repo(github_repo):
assert github_repo.created_at
assert github_repo.object is not None
assert github_repo.object.created_at
"""


Expand Down

0 comments on commit acdd1de

Please sign in to comment.