Repository navigation
test: enforce precise exception assertions across tests and examples - #794
Conversation
|
👋 Hi @rokkalababu-dotcom — thank you so much for your first contribution to HFlow! A maintainer will review your pull request as soon as possible. In the meantime:
💡 Tip: one open pull request per contributor at a time. Before starting an issue, check its sidebar for an assignee or a linked pull request. Either one means somebody is already on it; everything else is fair game. We are excited to have you here and appreciate your help making the project better! 🙌 |
[Low impact] This PR appears safe to merge; no actionable issues were found.
|
kstonekuan
left a comment
There was a problem hiding this comment.
LGTM, merging. 20 findings on main for these rules, 0 on your branch (both examples too), 2638 passed. Thanks!
Summary
Strengthen existing exception assertions so tests verify the intended failure reason and cannot pass because an unrelated operation raised the same exception class.
Closes #790.
Changes
PT010,PT011,PT012,PT014,PT016,PT028,PT030andPT031.pytest.raisesand isolate the failing operation while preserving context-manager cleanup, streaming behavior and assertions about prior successful results.No production code or stored-data behavior changes. Existing
PT018remains enabled;PT017remains outside this change as requested in #790 and tracked by #792. No tests were added merely to increase the test count.Validation
Local checks on macOS with Python 3.14.6 and FFmpeg available, using the locked root environment and separate locked environments for each affected example:
.venv/bin/python -m ruff check .— passed..venv/bin/python -m ruff format --check .— passed..venv/bin/ty check— passed..venv/bin/python -m pytest tests -q— 2331 passed, 47 skipped; the root virtualenv scripts and FFmpeg were on PATH.The opt-in network and Docker runtime checks were not enabled.
Checklist
AI assistance
AI assistance was used to prepare the test changes, lint configuration and PR description, and to execute the listed local checks.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.