You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ddd4948
Browse filesBrowse the repository at this point in the historyBrowse files
ci(ruff): Enable PT011 for overly broad pytest.raises() (#8286)
### Description
Turns on ruff's `PT011`, which flags `pytest.raises()` with a broad
exception type such as `ValueError` or `Exception` and no `match=`.
Without `match=`, a test can pass on the wrong error.
The 27 existing offenders are fixed rather than ignored. Most get a
`match=` with the expected message. Two get a narrower exception type
(`CannotSendRequest` in the httplib test, `ZeroDivisionError` in a
skipped celery test), and `test_get_error_message` no longer misuses
`pytest.raises()` as an attribute holder.
Each ruff-rule PR (#8282, #8283, #8285, #8286, #8287) targets `master`
on its own. They all add a line to the same `select` list in
`pyproject.toml`, so whichever merges first leaves the others with a
small conflict there to resolve.
<!-- junior-request-attribution:start -->
via @sentrivana.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0CAA8NNBE3%3A1794392136.309249 -->
--
[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0CAA8NNBE3%3A1794392136.309249)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0CAA8NNBE3%3A1794392136.309249/?project=4510944073809921)
<!-- junior-session-footer:end -->
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Ivana Kellyer <131587164+sentrivana@users.noreply.github.com>
Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
0 commit comments