Skip to content

test: cover PyMeasureDriver role dispatch and lifecycle - #70

Merged
Anai-Guo merged 1 commit into
mainfrom
chore/auto-maint-2026-11-23
Nov 24, 2026
Merged

Anai-Guo merged 1 commit into
mainfrom
chore/auto-maint-2026-11-23

Conversation

@Anai-Guo

Copy link
Copy Markdown
Owner

Automated maintenance

Type: tests
Change: Add fake-object tests for PyMeasureDriver lifecycle and role-method dispatch in drivers/pymeasure_adapter.py.
Evidence: pytest --cov reported 51% line coverage for drivers/pymeasure_adapter.py (103 of 209 lines missed): connect(), disconnect() and most fallback / unsupported-instrument branches were untested.
Verification: pytest 704 passed (module coverage 51% -> 100%); ruff check and ruff format --check clean. No driver source was changed; pymeasure is never imported.
Reference: none

Opened by the daily maintenance task. It is merged automatically on the next run once CI is green.
To stop that, add the hold label or convert this PR to a draft.

🤖 Generated with Claude Code

drivers/pymeasure_adapter.py had 51% line coverage: connect(), disconnect()
and most role-method fallback branches (read() fallback, setpoint property,
LCR bias/capacitance paths, unknown-instrument errors) were never exercised.
Plain fake classes are used instead of MagicMock so hasattr-based dispatch
sees only the attributes each fake defines. pymeasure is never imported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Anai-Guo
Anai-Guo merged commit 15910e2 into main Nov 24, 2026
3 checks passed
@Anai-Guo
Anai-Guo deleted the chore/auto-maint-2026-11-23 branch November 24, 2026 11:29
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