Skip to content
Open
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
11 changes: 0 additions & 11 deletions .github/CODEOWNERS

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
jobs:
py_job:
name: Python CI
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# Editor/IDE
.vscode
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coverage==5.2
pytest==5.4.3
pytest-cov==2.10.0
pytest-json==0.4.0
flake8==3.8.3
PyGithub==1.53
pytest-mock==3.3.1
coverage==6.4
pytest==7.1
pytest-cov==3.0
pytest-json==0.4
flake8==5.0
PyGithub==1.55
pytest-mock==3.8
17 changes: 9 additions & 8 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_build_comment_with_0_error_1_warning_found():

def test_comment_on_pr_with_repository_not_found(mocker):
get_repo_mock = mocker.patch.object(Github, "get_repo", autospec=True)
get_repo_mock.side_effect = UnknownObjectException(mocker.Mock(status=404), 'not found')
get_repo_mock.side_effect = UnknownObjectException(mocker.Mock(status=404), 'not found', [])

with pytest.raises(UnknownObjectException):
main.comment_on_pr('')
Expand All @@ -167,10 +167,12 @@ def test_comment_on_pr_with_pull_request_not_found(mocker):
repo_mock = MagicMock(wrap=Repository.Repository)
repo_mock.owner = 'org'
repo_mock.repo = 'trybe'
get_repo_mock.return_value = repo_mock
repo_mock.get_pull = MagicMock(
autospec=True,
side_effect=UnknownObjectException(mocker.Mock(status=404), 'not found', [])
)

get_pull_mock = mocker.patch.object(repo_mock, "get_pull", autospec=True)
get_pull_mock.side_effect = UnknownObjectException(mocker.Mock(status=404), 'not found')
get_repo_mock.return_value = repo_mock

with pytest.raises(UnknownObjectException):
main.comment_on_pr('')
Expand All @@ -181,11 +183,10 @@ def test_comment_on_pr(mocker):
repo_mock = MagicMock(wrap=Repository.Repository)
repo_mock.owner = 'betrybe'
repo_mock.repo = 'flake8-linter'
get_repo_mock.return_value = repo_mock

get_pull_mock = mocker.patch.object(repo_mock, "get_pull", autospec=True)
pr_mock = MagicMock(wrap=PullRequest.PullRequest)
get_pull_mock.return_value = pr_mock
repo_mock.get_pull = MagicMock(autospec=True, return_value=pr_mock)

get_repo_mock.return_value = repo_mock

main.comment_on_pr('### Lorem')

Expand Down