Skip to content

Conversation

@harupy
Copy link
Contributor

@harupy harupy commented Jan 13, 2026

Summary

  • Adds an alternative example to the PT017 (pytest-assert-in-except) rule documentation showing pytest's check parameter for validating exceptions, available since pytest 8.4.0

Closes #22529

Test plan

Documentation-only change. Verified with uvx prek run -a.

Adds an alternative example to the PT017 (`pytest-assert-in-except`) rule
documentation showing pytest's `check` parameter for validating exceptions,
available since pytest 8.4.0.

Closes astral-sh#22529

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

astral-sh-bot bot commented Jan 13, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre ntBre added the documentation Improvements or additions to documentation label Jan 13, 2026
@ntBre ntBre changed the title [flake8-pytest-style] Add check parameter example to PT017 docs [flake8-pytest-style] Add check parameter example to PT017 docs Jan 13, 2026
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ntBre ntBre merged commit c98ea1b into astral-sh:main Jan 13, 2026
42 checks passed
@harupy harupy deleted the docs/pt017-check-parameter branch January 14, 2026 03:48
AlexWaygood pushed a commit that referenced this pull request Jan 14, 2026
…#22546)

## Summary

- Adds an alternative example to the PT017 (`pytest-assert-in-except`)
rule documentation showing pytest's `check` parameter for validating
exceptions, available since pytest 8.4.0

Closes #22529

## Test plan

Documentation-only change. Verified with `uvx prek run -a`.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PT017: add pytest.raises(..., check=...) example (for pytest ≥ 8.4.0)

2 participants