Most devices managed by PnPQ require some sort of connection to be opened before commands are sent. This is perfect for the context manager pattern in Python, e.g. the with statement.
Prerequisites
PnPQ drivers should already be refactored to inherit from a common interface before starting this work. Implementing this pattern without a common interface will only cause more churn. See https://github.com/moonshot-nagayama-pj/PnPQ/issues/29
We should validate that code in testbed-manager, testbed-dashboard, etc. will work well with this pattern.
Acceptance criteria
PnPQ drivers now work with the with statement as appropriate for each device
Unit tests updated or written to test this pattern
Most devices managed by PnPQ require some sort of connection to be opened before commands are sent. This is perfect for the context manager pattern in Python, e.g. the
with
statement.Prerequisites
Acceptance criteria
with
statement as appropriate for each device