mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2026-02-09 00:28:40 +01:00
refactor(status): cleanup, remove error in test using 'and' instead of &
This commit is contained in:
@@ -75,12 +75,17 @@ class AndStatus(StatusBase):
|
||||
If any of the two Status objects fails, the combined status will fail
|
||||
with the exception of the first Status to fail.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
left: StatusBase
|
||||
The left-hand Status object
|
||||
right: StatusBase
|
||||
The right-hand Status object
|
||||
Args:
|
||||
left (StatusBase): Left status object.
|
||||
right (StatusBase): Right status object.
|
||||
|
||||
Examples:
|
||||
>>> status1 = StatusBase(device1)
|
||||
>>> status2 = StatusBase(device2)
|
||||
>>> status3 = StatusBase(device3)
|
||||
>>> combined_status = AndStatus(status1, status2)
|
||||
>>> combined_status = status1 & status2
|
||||
>>> combined_status = status1 & status2 & status3
|
||||
"""
|
||||
|
||||
def __init__(self, left, right, **kwargs):
|
||||
|
||||
@@ -970,7 +970,7 @@ def test_patched_status_objects():
|
||||
dev_status = DeviceStatus(device=dev)
|
||||
|
||||
st = Status()
|
||||
and_st = st and dev_status
|
||||
and_st = st & dev_status
|
||||
assert dev_status.device == dev
|
||||
dev_status.set_exception(RuntimeError("device error"))
|
||||
with pytest.raises(RuntimeError):
|
||||
|
||||
Reference in New Issue
Block a user