Skip to content

test(zwave_js): use patch.object instead of monkeypatch for runtime_data#1281

Merged
raman325 merged 1 commit into
mainfrom
test/zwave-monkeypatch-to-patch
Jun 22, 2026
Merged

test(zwave_js): use patch.object instead of monkeypatch for runtime_data#1281
raman325 merged 1 commit into
mainfrom
test/zwave-monkeypatch-to-patch

Conversation

@raman325

Copy link
Copy Markdown
Owner

Proposed change

Convert the three _get_client_state readiness tests in tests/providers/zwave_js/test_provider.py off the pytest monkeypatch fixture to unittest.mock.patch.object, matching the patching style used elsewhere in the suite.

The change is behaviorally identical -- both set and then restore runtime_data on the lock's config entry -- and scopes the patch to the call under test via a with block. Split out of the #1279 review follow-up to keep that PR focused.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:

🤖 Generated with Claude Code

Convert the three _get_client_state readiness tests off the pytest
monkeypatch fixture to unittest.mock.patch.object, matching the patching
style used elsewhere in the suite. Behaviorally identical -- both set and
restore runtime_data on the lock's config entry -- and scopes the patch to
the call under test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 22, 2026 02:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added python Pull requests that update Python code code-quality Pull requests that improve code quality labels Jun 22, 2026
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.10%. Comparing base (b416bc8) to head (08f97a7).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1281   +/-   ##
=======================================
  Coverage   97.10%   97.10%           
=======================================
  Files          54       54           
  Lines        6553     6553           
  Branches      460      460           
=======================================
  Hits         6363     6363           
  Misses        190      190           
Flag Coverage Δ
python 97.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@raman325 raman325 merged commit 5f5163c into main Jun 22, 2026
18 checks passed
@raman325 raman325 deleted the test/zwave-monkeypatch-to-patch branch June 22, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality Pull requests that improve code quality python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants