Skip to content

Commit

Permalink
upgrade ruff version and reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
kivel committed Jan 15, 2025
1 parent fa0a768 commit 7f0e8fa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
24 changes: 12 additions & 12 deletions src/ophyd_async/testing/_assert.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ async def assert_reading(
"""
actual_reading = await readable.read()
assert (
_approx_readable_value(expected_reading) == actual_reading
), _generate_assert_error_msg(
name=readable.name,
expected_result=expected_reading,
actual_result=actual_reading,
assert _approx_readable_value(expected_reading) == actual_reading, (
_generate_assert_error_msg(
name=readable.name,
expected_result=expected_reading,
actual_result=actual_reading,
)
)


Expand All @@ -109,12 +109,12 @@ async def assert_configuration(
"""
actual_configurable = await configurable.read_configuration()
assert (
_approx_readable_value(configuration) == actual_configurable
), _generate_assert_error_msg(
name=configurable.name,
expected_result=configuration,
actual_result=actual_configurable,
assert _approx_readable_value(configuration) == actual_configurable, (
_generate_assert_error_msg(
name=configurable.name,
expected_result=configuration,
actual_result=actual_configurable,
)
)


Expand Down
6 changes: 3 additions & 3 deletions src/ophyd_async/testing/_mock_signal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def get_mock(device: Device | Signal) -> Mock:
def _get_mock_signal_backend(signal: Signal) -> MockSignalBackend:
connector = signal._connector # noqa: SLF001
assert isinstance(connector, SignalConnector), f"Expected Signal, got {signal}"
assert isinstance(
connector.backend, MockSignalBackend
), f"Signal {signal} not connected in mock mode"
assert isinstance(connector.backend, MockSignalBackend), (
f"Signal {signal} not connected in mock mode"
)
return connector.backend


Expand Down
3 changes: 1 addition & 2 deletions tests/fastcs/panda/test_seq_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ def test_seq_table_validation_errors():
with pytest.raises(
ValidationError,
match=(
"1 validation error for SeqTable\n "
"Value error, Length 4097 is too long."
"1 validation error for SeqTable\n Value error, Length 4097 is too long."
),
):
large_seq_table + SeqTable.row()
Expand Down
6 changes: 3 additions & 3 deletions tests/sim/test_sim_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
async def test_sim_pattern_detector_initialization(
sim_pattern_detector: PatternDetector,
):
assert (
sim_pattern_detector.pattern_generator
), "PatternGenerator was not initialized correctly."
assert sim_pattern_detector.pattern_generator, (
"PatternGenerator was not initialized correctly."
)


async def test_detector_creates_controller_and_writer(
Expand Down

0 comments on commit 7f0e8fa

Please sign in to comment.