Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit 8367a5f

Browse files
committed
Fix missing return type annotations on constructors with no arguments
As discussed in python/mypy#604, functions with at least one argument type annotation are allowed to omit the return type annotation, in which case it defaults to `None`. However, functions with no arguments cannot have argument type annotations, so the return type of `None` must be explicitly specified.
1 parent 3622312 commit 8367a5f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

tests/components/test_button.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class MockButtonDriver(ButtonInterface):
1111
"""A testing driver for the button component."""
1212

13-
def __init__(self):
13+
def __init__(self) -> None:
1414
self.state = False
1515

1616
def set_button_state(self, new_state: bool) -> None:

tests/components/test_gpio_pin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class MockGPIOPinDriver(GPIOPinInterface):
1717
"""A testing driver for the GPIO pin component."""
1818

19-
def __init__(self):
19+
def __init__(self) -> None:
2020

2121
self.pin_count: int = 10
2222
self._mode: List[GPIOPinMode] = [

tests/components/test_power_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class MockPowerOutputDriver(PowerOutputInterface):
99
"""A testing driver for power outputs."""
1010

11-
def __init__(self):
11+
def __init__(self) -> None:
1212
self._enabled = False
1313

1414
def get_power_output_enabled(self, identifier: int) -> bool:

tests/test_stack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class Robot(BaseRobot):
1515
"""A robot."""
1616

17-
def __init__(self):
17+
def __init__(self) -> None:
1818
self._env = TestEnvironment
1919

2020

0 commit comments

Comments
 (0)