Skip to content

Commit e946940

Browse files
authored
Fix test for latest ophyd-async (#1693)
1 parent 2050056 commit e946940

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/devices/i24/test_pmac.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,16 @@ async def test_set_pmac_string_for_enc_reset(fake_pmac: PMAC, run_engine: RunEng
6868

6969

7070
async def test_run_program(fake_pmac: PMAC):
71-
async def go_high_then_low():
72-
set_mock_value(fake_pmac.scanstatus, 1)
73-
await asyncio.sleep(0.01)
74-
set_mock_value(fake_pmac.scanstatus, 0)
71+
def go_high_then_low(value, *_, **__):
72+
async def async_go_high_then_low():
73+
set_mock_value(fake_pmac.scanstatus, 1)
74+
await asyncio.sleep(0.01)
75+
set_mock_value(fake_pmac.scanstatus, 0)
7576

76-
callback_on_mock_put(
77-
fake_pmac.pmac_string,
78-
lambda *args, **kwargs: asyncio.create_task(go_high_then_low()), # type: ignore
79-
)
77+
asyncio.create_task(async_go_high_then_low())
78+
return value
79+
80+
callback_on_mock_put(fake_pmac.pmac_string, go_high_then_low)
8081

8182
set_mock_value(fake_pmac.program_number, 11)
8283
await fake_pmac.run_program.kickoff()

0 commit comments

Comments
 (0)