diff --git a/src/pandablocks/_exchange.py b/src/pandablocks/_exchange.py index 9eebc95b..14474d10 100644 --- a/src/pandablocks/_exchange.py +++ b/src/pandablocks/_exchange.py @@ -27,9 +27,9 @@ def check_ok(self): @property def line(self) -> str: """Check received is not multiline and return the line""" - assert not self.is_multiline and self.received[0].startswith( - "OK =" - ), self._error_message() + assert not self.is_multiline and self.received[0].startswith("OK ="), ( + self._error_message() + ) # Remove the OK= header return self.received[0][4:] diff --git a/src/pandablocks/connections.py b/src/pandablocks/connections.py index fd77001e..ab6502d2 100644 --- a/src/pandablocks/connections.py +++ b/src/pandablocks/connections.py @@ -215,14 +215,14 @@ def receive_bytes(self, received: bytes) -> bytes: is_multiline = False else: # Check a correctly formatted response - assert line.startswith( - "!" - ), f"Multiline response {line} doesn't start with !" + assert line.startswith("!"), ( + f"Multiline response {line} doesn't start with !" + ) else: # Single line mode - assert ( - not self._lines - ), f"Multiline response {self._lines} not terminated" + assert not self._lines, ( + f"Multiline response {self._lines} not terminated" + ) to_send += self._update_contexts([line]) return to_send diff --git a/tests/test_hdf.py b/tests/test_hdf.py index 298aa6c7..2c567964 100644 --- a/tests/test_hdf.py +++ b/tests/test_hdf.py @@ -89,8 +89,7 @@ def test_field_capture_pcap_bits(): with pytest.raises( ValueError, match=( - "If any of `scale=None`, `offset=0.0`, or " - "`units=` is set, all must be set" + "If any of `scale=None`, `offset=0.0`, or `units=` is set, all must be set" ), ): _ = FieldCapture( diff --git a/tests/test_pandablocks.py b/tests/test_pandablocks.py index 9d8c0440..e42c5bb5 100644 --- a/tests/test_pandablocks.py +++ b/tests/test_pandablocks.py @@ -897,9 +897,9 @@ def test_get_fields_parameterized_type( expected_requests.pop(idx) responses.pop(idx) - assert ( - not expected_requests - ), f"Did not receive all expected requests: {expected_requests}" + assert not expected_requests, ( + f"Did not receive all expected requests: {expected_requests}" + ) assert get_responses(conn) == [ (