Skip to content

Commit 19a1f28

Browse files
committed
Clarify test, make assertion more precise
1 parent cadd746 commit 19a1f28

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ def test_event_hooks_default(monkeypatch, respx_mock: respx.mock):
7171

7272
api_client = ApiClient(http_client=HttpClient(token=GITHUB_TOKEN))
7373

74-
with pytest.raises(httpx.HTTPStatusError):
74+
with pytest.raises(httpx.HTTPStatusError) as excinfo:
7575
api_client.import_issue(
7676
"foo",
7777
"bar",
7878
IssueImportRequest.model_validate_json(get_fixture("request-issue-and-comment-fields.json")),
7979
)
80+
assert "502 Bad Gateway" in str(excinfo.value)
8081

8182
mock_log_request.assert_called_once()
8283
mock_log_response.assert_called_once()

0 commit comments

Comments
 (0)