Update to ophyd-async v0.20.1 - #2122
Conversation
ophyd-async 0.20.1 adds set_mock_attr (in ophyd_async.core) and enforces that test code can no longer assign directly to attribute names that collide with bluesky protocol verbs (set, read, trigger, kickoff, complete, prepare, describe, check_value). Replace direct assignments like `signal.set = AsyncMock(...)` with `set_mock_attr(signal, "set", AsyncMock(...))` across the affected test files and fixtures. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EQPRwf3pUved4ihrBLPi1g
The set_mock_attr fixes in the previous commit cover every reserved-attr NameError that this autouse fixture was blanket-suppressing, so the mask is no longer needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EQPRwf3pUved4ihrBLPi1g
ophyd-async 0.20.1
|
set_mock_attr(device, "attr", mock) doesn't let pyright narrow device.attr to the mock's type, so later device.attr.assert_*() calls failed with reportAttributeAccessIssue. Capture set_mock_attr's return value (it returns the mock unchanged, per its own docstring) and assert on that instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EQPRwf3pUved4ihrBLPi1g
|
Fixed a pyright regression from the Generated by Claude Code |
…LightSource/dodal into update_to_ophyd_async_0_20
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2122 +/- ##
==========================================
- Coverage 99.16% 99.16% -0.01%
==========================================
Files 354 354
Lines 13842 13841 -1
==========================================
- Hits 13726 13725 -1
Misses 116 116 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
CI is fully green now — the "Standardise config client" merge (#2099) replaced the duplicate Generated by Claude Code |
Update to latest ophyd-async version v0.20.1
Instructions to reviewer on how to test:
1.Check tests pass
2. Check AI conversions of setting mock bluesky verbs done correctly
Checks for reviewer
dodal connect ${BEAMLINE}