Skip to content

Commit

Permalink
CI does not believe in caplog :/, by Piotr
Browse files Browse the repository at this point in the history
  • Loading branch information
caseneuve committed Aug 11, 2023
1 parent 5b5cfaf commit dff92d1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_students.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ def test_returns_empty_list_when_no_usernames_found_in_api_response(self, mocker
({"students": [{"username": "one"}]}, "You have 1 student!"),
]
)
def test_uses_correct_grammar_in_log_messages(
self, mocker, api_response, expected_wording, caplog
):
def test_uses_correct_grammar_in_log_messages(self, mocker, api_response, expected_wording):
mock_students_api_get = mocker.patch("pythonanywhere.api.students_api.StudentsAPI.get")
mock_students_api_get.return_value = api_response
mock_snake = mocker.patch("pythonanywhere.students.snakesay")
mock_info = mocker.patch("pythonanywhere.students.logger.info")

Students().get()

assert expected_wording in caplog.text
assert mock_snake.call_args == call(expected_wording)
assert mock_info.call_args == call(mock_snake.return_value)


@pytest.mark.students
Expand Down

0 comments on commit dff92d1

Please sign in to comment.