Skip to content

Commit f882ae9

Browse files
committed
remove import logic for motorlimitserror
1 parent 0283d2e commit f882ae9

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/ibex_bluesky_core/devices/block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def set( # pyright: ignore
484484
This is needed so that type-checker correctly understands the type of set.
485485
486486
This method will raise
487-
:external+ophyd_async:py:obj:`ophyd_async.epics.motor.MotorLimitsException`
487+
:external+ophyd_async:py:obj:`ophyd_async.epics.motor.MotorLimitsError`
488488
if the requested position was outside the motor's limits.
489489
"""
490490
return super().set(value, timeout)

tests/devices/test_block.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
import bluesky.plan_stubs as bps
66
import bluesky.plans as bp
7-
import ophyd_async
87
import pytest
98
from ophyd_async.core import get_mock_put, set_mock_value
9+
from ophyd_async.epics.motor import MotorLimitsError
1010

1111
from ibex_bluesky_core.devices.block import (
1212
GLOBAL_MOVING_FLAG_PRE_WAIT,
@@ -353,23 +353,13 @@ async def test_block_mot_set_within_limits(mot_block):
353353

354354

355355
async def test_block_mot_set_outside_limits(mot_block):
356-
# Local import as API not available in older ophyd_async versions
357-
if ophyd_async._version.version_tuple >= (0, 13, 5):
358-
from ophyd_async.epics.motor import MotorLimitsError # pyright: ignore # noqa PLC0415
359-
360-
err = MotorLimitsError
361-
else:
362-
from ophyd_async.epics.motor import MotorLimitsException # pyright: ignore # noqa PLC0415
363-
364-
err = MotorLimitsException
365-
366356
set_mock_value(mot_block.user_setpoint, 10)
367357
set_mock_value(mot_block.velocity, 10)
368358
set_mock_value(mot_block.dial_high_limit_travel, 15)
369359
set_mock_value(mot_block.dial_low_limit_travel, 5)
370360
set_mock_value(mot_block.high_limit_travel, 15)
371361
set_mock_value(mot_block.low_limit_travel, 5)
372-
with pytest.raises(err):
362+
with pytest.raises(MotorLimitsError):
373363
await mot_block.set(20)
374364

375365

0 commit comments

Comments
 (0)