File tree Expand file tree Collapse file tree 2 files changed +1
-7
lines changed Expand file tree Collapse file tree 2 files changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def query(self, request: str) -> str:
65
65
"""
66
66
# Assert that we have not run out of responses
67
67
# and that the request is the next one we expect
68
- assert self .request_index < len (self .responses )
68
+ assert self .request_index < len (self .responses ), f"Unexpected request: { request } "
69
69
assert request == self .responses [self .request_index ][0 ]
70
70
71
71
# Fetch the response and increment the request index
Original file line number Diff line number Diff line change @@ -147,14 +147,8 @@ def test_arduino_pins(arduino_serial: MockArduino) -> None:
147
147
148
148
# Test that we can get the analog value of a pin
149
149
arduino_serial .serial_wrapper ._add_responses ([
150
- ("PIN:2:MODE:GET?" , "OUTPUT" ), # mode is read before analog value
151
- ("PIN:2:MODE:GET?" , "OUTPUT" ),
152
- ("PIN:10:MODE:GET?" , "INPUT" ),
153
- ("PIN:14:MODE:GET?" , "INPUT" ),
154
150
("PIN:14:ANALOG:GET?" , "1000" ),
155
151
])
156
- with pytest .raises (IOError , match = r"Analog read is not supported.*" ):
157
- arduino .pins [2 ].analog_value
158
152
with pytest .raises (IOError , match = r"Pin does not support analog read" ):
159
153
arduino .pins [10 ].analog_value
160
154
# 4.888 = round((5 / 1023) * 1000, 3)
You can’t perform that action at this time.
0 commit comments