diff --git a/src/fastcs/attributes.py b/src/fastcs/attributes.py index b99b6b8f..95426385 100644 --- a/src/fastcs/attributes.py +++ b/src/fastcs/attributes.py @@ -69,9 +69,10 @@ def __init__( allowed_values: list[T] | None = None, description: str | None = None, ) -> None: - assert ( - datatype.dtype in ATTRIBUTE_TYPES - ), f"Attr type must be one of {ATTRIBUTE_TYPES}, received type {datatype.dtype}" + assert datatype.dtype in ATTRIBUTE_TYPES, ( + f"Attr type must be one of {ATTRIBUTE_TYPES}" + ", received type {datatype.dtype}" + ) self._datatype: DataType[T] = datatype self._access_mode: AttrMode = access_mode self._group = group diff --git a/src/fastcs/backend.py b/src/fastcs/backend.py index e2d74f25..07b26171 100644 --- a/src/fastcs/backend.py +++ b/src/fastcs/backend.py @@ -83,9 +83,9 @@ def _link_attribute_sender_class(single_mapping: SingleMapping) -> None: for attr_name, attribute in single_mapping.attributes.items(): match attribute: case AttrW(sender=Sender()): - assert ( - not attribute.has_process_callback() - ), f"Cannot assign both put method and Sender object to {attr_name}" + assert not attribute.has_process_callback(), ( + f"Cannot assign both put method and Sender object to {attr_name}" + ) callback = _create_sender_callback(attribute, single_mapping.controller) attribute.set_process_callback(callback) diff --git a/src/fastcs/transport/epics/util.py b/src/fastcs/transport/epics/util.py index b1ffa608..c63b3cf8 100644 --- a/src/fastcs/transport/epics/util.py +++ b/src/fastcs/transport/epics/util.py @@ -36,9 +36,9 @@ def attr_is_enum(attribute: Attribute) -> bool: """ match attribute: - case Attribute( - datatype=String(), allowed_values=allowed_values - ) if allowed_values is not None and len(allowed_values) <= MBB_MAX_CHOICES: + case Attribute(datatype=String(), allowed_values=allowed_values) if ( + allowed_values is not None and len(allowed_values) <= MBB_MAX_CHOICES + ): return True case _: return False diff --git a/tests/test_launch.py b/tests/test_launch.py index cafae874..ce26573f 100644 --- a/tests/test_launch.py +++ b/tests/test_launch.py @@ -102,7 +102,7 @@ def test_over_defined_schema(): def test_version(): impl_version = "0.0.1" - expected = f"SingleArg: {impl_version}\n" f"FastCS: {__version__}\n" + expected = f"SingleArg: {impl_version}\nFastCS: {__version__}\n" app = _launch(SingleArg, version=impl_version) result = runner.invoke(app, ["version"]) assert result.exit_code == 0 diff --git a/tests/transport/epics/test_ioc.py b/tests/transport/epics/test_ioc.py index 516cb906..3e71891e 100644 --- a/tests/transport/epics/test_ioc.py +++ b/tests/transport/epics/test_ioc.py @@ -436,7 +436,7 @@ def test_long_pv_names_discarded(mocker: MockerFixture): assert long_name_controller.command_short_name.fastcs_method.enabled long_command_name = ( - "command_with_" "reallyreallyreallyreallyreallyreallyreally_long_name" + "command_with_reallyreallyreallyreallyreallyreallyreally_long_name" ) assert not getattr(long_name_controller, long_command_name).fastcs_method.enabled