From 626bbd38670da48d9438e41f0e7d277a14e82d2d Mon Sep 17 00:00:00 2001 From: Mark Wolfman Date: Wed, 16 Oct 2024 14:46:31 -0500 Subject: [PATCH] Black, isort, and flake8. --- src/ophydregistry/registry.py | 5 ++++- src/ophydregistry/tests/test_instrument_registry.py | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ophydregistry/registry.py b/src/ophydregistry/registry.py index b076d5a..379544c 100644 --- a/src/ophydregistry/registry.py +++ b/src/ophydregistry/registry.py @@ -519,7 +519,10 @@ def __new__wrapper(self, cls, *args, **kwargs): return obj def register( - self, component: ophydobj.OphydObject, labels: Optional[Sequence] = None, warn_duplicates=True + self, + component: ophydobj.OphydObject, + labels: Optional[Sequence] = None, + warn_duplicates=True, ) -> ophydobj.OphydObject: """Register a device, component, etc so that it can be retrieved later. diff --git a/src/ophydregistry/tests/test_instrument_registry.py b/src/ophydregistry/tests/test_instrument_registry.py index 8f8e05e..09cc621 100644 --- a/src/ophydregistry/tests/test_instrument_registry.py +++ b/src/ophydregistry/tests/test_instrument_registry.py @@ -6,7 +6,8 @@ import pytest from ophyd import Device, EpicsMotor, sim -from ophyd_async.core import Device as AsyncDevice, soft_signal_rw +from ophyd_async.core import Device as AsyncDevice +from ophyd_async.core import soft_signal_rw from ophydregistry import ComponentNotFound, MultipleComponentsFound, Registry @@ -146,11 +147,12 @@ def test_find_component(registry): def test_find_async_children(registry): """Check that the child components of an async device get registered.""" + class MyDevice(AsyncDevice): def __init__(self, name): self.signal = soft_signal_rw() super().__init__(name=name) - + device = MyDevice(name="m1") registry.register(device) assert registry.find(device.signal.name) is device.signal @@ -411,7 +413,7 @@ def test_duplicate_device(caplog, registry): # Check that the warning is only issued for the top-level device, not all its children assert "motor_user_setpoint" not in caplog.text # Check that the correct second device is the one that wound up in the registry - assert registry['motor'] is motor2 + assert registry["motor"] is motor2 def test_delete_by_name(registry):