fix: bump ophyd version to 1.10, remove patch, fix corresponding test

This commit is contained in:
2024-12-04 11:33:37 +01:00
parent 35f3819c03
commit f166847387
4 changed files with 7 additions and 103 deletions

View File

@ -6,11 +6,10 @@ import pytest
from ophyd.status import DeviceStatus, StatusBase, StatusTimeoutError
def test_ophyd_status_patch():
assert StatusBase._bec_patched
st = DeviceStatus(device="test")
assert st._bec_patched
def test_ophyd_status():
device = Mock()
device.name.return_value = "test"
st = DeviceStatus(device)
assert isinstance(st, StatusBase)
cb = Mock()
@ -25,7 +24,7 @@ def test_ophyd_status_patch():
cb.reset_mock()
st = StatusBase()
assert isinstance(st._callback_thread, Mock)
assert st._callback_thread is None
st.add_callback(cb)
st.set_finished()
cb.assert_called_once()
@ -34,7 +33,7 @@ def test_ophyd_status_patch():
st = StatusBase(settle_time=1)
st.add_callback(cb)
assert isinstance(st._callback_thread, Mock)
assert st._callback_thread is None
st.set_finished()
assert cb.call_count == 0
time.sleep(0.5)