Something like this might help: https://github.com/bluesky/ophyd-async/blob/d4628cdda7e6758404d08a192e21ebfad85924b2/tests/conftest.py#L66-L95