Skip to content

[flake8-pytest-style] Support check parameter in PT011#22725

Merged
MichaReiser merged 1 commit intoastral-sh:mainfrom
harupy:pt011-support-check-parameter
Jan 21, 2026
Merged

[flake8-pytest-style] Support check parameter in PT011#22725
MichaReiser merged 1 commit intoastral-sh:mainfrom
harupy:pt011-support-check-parameter

Conversation

@harupy
Copy link
Contributor

@harupy harupy commented Jan 19, 2026

Summary

PT011 (pytest-raises-too-broad) now recognizes the check parameter introduced in pytest 8.4.0.

Closes #22673

Test plan

Added test cases for check parameter (valid callback and check=None).

PT011 (`pytest-raises-too-broad`) now recognizes the `check` parameter
introduced in pytest 8.4.0. When a valid `check` callback is provided,
the rule no longer triggers a false positive since the exception is
being constrained.

Closes astral-sh#22673

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 19, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Jan 21, 2026
@MichaReiser
Copy link
Member

Thank you

@MichaReiser MichaReiser merged commit f108c50 into astral-sh:main Jan 21, 2026
42 checks passed
@harupy harupy deleted the pt011-support-check-parameter branch January 21, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PT011] Support pytest 8.4.0 check parameter

3 participants