From 459d23eaf4323e008ebd9f1ff589c784e2891bb5 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Thu, 14 Mar 2024 12:57:30 -0400 Subject: [PATCH] use decoy better --- .../execution/test_pipetting_handler.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/api/tests/opentrons/protocol_engine/execution/test_pipetting_handler.py b/api/tests/opentrons/protocol_engine/execution/test_pipetting_handler.py index 5ee6e5dfd69..b087084abff 100644 --- a/api/tests/opentrons/protocol_engine/execution/test_pipetting_handler.py +++ b/api/tests/opentrons/protocol_engine/execution/test_pipetting_handler.py @@ -502,17 +502,6 @@ async def test_aspirate_volume_validation( not_ok_volume = 1.01 expected_adjusted_volume = 1 - decoy.when( - mock_command_note_adder( - cast( - CommandNote, - CommandNoteMatcher( - matching_noteKind_regex="warning", - matching_shortMessage_regex="Aspirate clamped to 1 µL", - ), - ) - ) - ).then_return(None) for subject in [virtual_subject, hardware_subject]: assert ( await subject.aspirate_in_place( @@ -523,6 +512,17 @@ async def test_aspirate_volume_validation( ) == expected_adjusted_volume ) + decoy.verify( + mock_command_note_adder( + cast( + CommandNote, + CommandNoteMatcher( + matching_noteKind_regex="warning", + matching_shortMessage_regex="Aspirate clamped to 1 µL", + ), + ) + ) + ) with pytest.raises(InvalidAspirateVolumeError): await subject.aspirate_in_place( pipette_id="pipette-id",