Skip to content

Commit

Permalink
chore(hardware-testing): bump mypy slightly to fix failed ci tests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau authored Nov 15, 2024
1 parent 32c6e08 commit 99b9f76
Show file tree
Hide file tree
Showing 10 changed files with 579 additions and 293 deletions.
2 changes: 1 addition & 1 deletion hardware-testing/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ atomicwrites = "==1.4.1"
colorama = "==0.4.4"
pytest = "==7.1.1"
pytest-cov = "==2.10.1"
mypy = "==0.981"
mypy = "==0.990"
black = "==22.3.0"
flake8 = "~=3.9.0"
flake8-annotations = "~=2.6.2"
Expand Down
479 changes: 255 additions & 224 deletions hardware-testing/Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hardware-testing/hardware_testing/drivers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .radwag import RadwagScaleBase, RadwagScale, SimRadwagScale


def list_ports_and_select(device_name: str = "", port_substr: str = None) -> str:
def list_ports_and_select(device_name: str = "", port_substr: str = "") -> str:
"""List serial ports and display list for user to select from."""
ports = comports()
assert ports, "no serial ports found"
Expand Down
4 changes: 2 additions & 2 deletions hardware-testing/hardware_testing/drivers/asair_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
class AsairSensorError(Exception):
"""Asair sensor error."""

def __init__(self, ret_code: str = None) -> None:
def __init__(self, ret_code: str = "") -> None:
"""Constructor."""
super().__init__(ret_code)

Expand Down Expand Up @@ -75,7 +75,7 @@ def get_serial(self) -> str:


def BuildAsairSensor(
simulate: bool, autosearch: bool = True, port_substr: str = None
simulate: bool, autosearch: bool = True, port_substr: str = ""
) -> AsairSensorBase:
"""Try to find and return an Asair sensor, if not found return a simulator."""
ui.print_title("Connecting to Environmental sensor")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1014,13 +1014,13 @@ def set_pipette_offset_ot3(api: OT3API, mount: OT3Mount, offset: Point) -> None:

def get_gripper_offset_ot3(api: OT3API) -> Point:
"""Get gripper offset OT3."""
assert api.has_gripper, "No gripper found"
assert api.has_gripper(), "No gripper found"
return api._gripper_handler._gripper._calibration_offset.offset # type: ignore[union-attr]


def set_gripper_offset_ot3(api: OT3API, offset: Point) -> None:
"""Set gripper offset OT3."""
assert api.has_gripper, "No gripper found"
assert api.has_gripper(), "No gripper found"
api._gripper_handler._gripper._calibration_offset.offset = offset # type: ignore[union-attr]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ async def run(api: OT3API, report: CSVReport, section: str) -> None:
await _test_wifi(report, section)
else:
report(section, "wifi", ["", "", "0.0.0.0", CSVResult.PASS])
assert nmcli.iface_info
assert nmcli.configure
assert nmcli.wifi_disconnect
assert nmcli.iface_info is not None
assert nmcli.configure is not None
assert nmcli.wifi_disconnect is not None

# USB-B-REAR
ui.print_header("USB-B-REAR")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
async def _get_ip(api: OT3API) -> Optional[str]:
_ip: Optional[str] = None
if api.is_simulator:
assert nmcli.iface_info
assert nmcli.iface_info is not None
_ip = "127.0.0.1"
else:
ethernet_status = await nmcli.iface_info(nmcli.NETWORK_IFACES.ETH_LL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async def _move_and_interrupt_with_signal(api: OT3API, sig_name: str) -> None:
runner = MoveGroupRunner(move_groups=[[_move_group_nsync]])
if api.is_simulator:
# test that the required functionality exists
assert runner.run
assert runner.run is not None
else:
backend: OT3Controller = api._backend # type: ignore[assignment]
messenger = backend._messenger
Expand Down
Loading

0 comments on commit 99b9f76

Please sign in to comment.