Skip to content

Commit fb5f26c

Browse files
DominicOramsrishtysajeev
authored andcommitted
Better mock the aperture scatterguard
1 parent 2aaf02f commit fb5f26c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/devices/test_scintillator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections.abc import AsyncGenerator
22
from contextlib import ExitStack
3-
from unittest.mock import MagicMock
3+
from unittest.mock import AsyncMock, MagicMock
44

55
import pytest
66
from ophyd_async.core import init_devices
@@ -32,6 +32,8 @@ async def scintillator_and_ap_sg(
3232
) -> AsyncGenerator[tuple[Scintillator, MagicMock], None]:
3333
async with init_devices(mock=True):
3434
mock_ap_sg = MagicMock()
35+
mock_ap_sg.return_value.selected_aperture.set = AsyncMock()
36+
mock_ap_sg.return_value.selected_aperture.get_value = AsyncMock()
3537
scintillator = Scintillator(
3638
prefix="",
3739
name="test_scin",

0 commit comments

Comments
 (0)