|
4 | 4 |
|
5 | 5 | import bluesky.plan_stubs as bps |
6 | 6 | import bluesky.plans as bp |
7 | | -import ophyd_async |
8 | 7 | import pytest |
9 | | -from ophyd_async.testing import get_mock_put, set_mock_value |
| 8 | +from ophyd_async.core import get_mock_put, set_mock_value |
| 9 | +from ophyd_async.epics.motor import MotorLimitsError |
10 | 10 |
|
11 | 11 | from ibex_bluesky_core.devices.block import ( |
12 | 12 | GLOBAL_MOVING_FLAG_PRE_WAIT, |
@@ -353,21 +353,13 @@ async def test_block_mot_set_within_limits(mot_block): |
353 | 353 |
|
354 | 354 |
|
355 | 355 | 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 | | - |
366 | 356 | set_mock_value(mot_block.user_setpoint, 10) |
367 | 357 | set_mock_value(mot_block.velocity, 10) |
| 358 | + set_mock_value(mot_block.dial_high_limit_travel, 15) |
| 359 | + set_mock_value(mot_block.dial_low_limit_travel, 5) |
368 | 360 | set_mock_value(mot_block.high_limit_travel, 15) |
369 | 361 | set_mock_value(mot_block.low_limit_travel, 5) |
370 | | - with pytest.raises(err): |
| 362 | + with pytest.raises(MotorLimitsError): |
371 | 363 | await mot_block.set(20) |
372 | 364 |
|
373 | 365 |
|
|
0 commit comments