Skip to content

Implement @pytest.mark.usefixtures()#1117

Merged
bouwew merged 5 commits into
mainfrom
test-fixes
Jul 25, 2026
Merged

Implement @pytest.mark.usefixtures()#1117
bouwew merged 5 commits into
mainfrom
test-fixes

Conversation

@bouwew

@bouwew bouwew commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Tests

    • Updated Plugwise integration tests to apply mock fixtures automatically using pytest fixture markers.
    • Simplified test signatures while preserving existing assertions, snapshots, and test behavior.
  • Documentation

    • Added a changelog entry documenting the adoption of usefixtures for test setup.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@bouwew, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c120d641-3a2c-4959-85f6-cd8881272753

📥 Commits

Reviewing files that changed from the base of the PR and between e295998 and 15566cc.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • tests/components/plugwise/test_binary_sensor.py
  • tests/components/plugwise/test_sensor.py
📝 Walkthrough

Walkthrough

Changes

Plugwise tests were refactored to provision Smile, Stretch, and config-entry fixtures through @pytest.mark.usefixtures(...) decorators instead of test function parameters. Test logic and assertions remain unchanged, and the changelog records the fixture usage implementation.

Fixture injection refactor

Layer / File(s) Summary
Entity test fixture wiring
CHANGELOG.md, tests/components/plugwise/test_*.py
Entity, snapshot, sensor, switch, select, climate, number, button, and water-heater tests now use fixture decorators while retaining their existing setup and assertions.
Migration and device test fixture wiring
tests/components/plugwise/test_init.py
Migration, device removal, and firmware tests now apply Smile and config-entry fixtures with usefixtures markers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: compatech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: replacing explicit fixture parameters with @pytest.mark.usefixtures() in Plugwise tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested a review from CoMPaTech July 25, 2026 13:19
@sonarqubecloud

Copy link
Copy Markdown

@bouwew
bouwew marked this pull request as ready for review July 25, 2026 13:44
@bouwew
bouwew requested a review from a team as a code owner July 25, 2026 13:44
@bouwew
bouwew merged commit 770083e into main Jul 25, 2026
13 checks passed
@bouwew
bouwew deleted the test-fixes branch July 25, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant