mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-07-08 14:52:03 +00:00
tests: add type annotations to Smart tests (#1686)
Some checks are pending
CI / Perform Lint Checks (3.14) (push) Waiting to run
CI / Python 3.11 on macos-latest (push) Blocked by required conditions
CI / Python 3.12 on macos-latest (push) Blocked by required conditions
CI / Python 3.13 on macos-latest (push) Blocked by required conditions
CI / Python 3.14 on macos-latest (push) Blocked by required conditions
CI / Python 3.11 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.12 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.13 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.14 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.11 on windows-latest (push) Blocked by required conditions
CI / Python 3.12 on windows-latest (push) Blocked by required conditions
CI / Python 3.13 on windows-latest (push) Blocked by required conditions
CI / Python 3.14 on windows-latest (push) Blocked by required conditions
CodeQL Checks / Analyze (python) (push) Waiting to run
Some checks are pending
CI / Perform Lint Checks (3.14) (push) Waiting to run
CI / Python 3.11 on macos-latest (push) Blocked by required conditions
CI / Python 3.12 on macos-latest (push) Blocked by required conditions
CI / Python 3.13 on macos-latest (push) Blocked by required conditions
CI / Python 3.14 on macos-latest (push) Blocked by required conditions
CI / Python 3.11 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.12 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.13 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.14 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.11 on windows-latest (push) Blocked by required conditions
CI / Python 3.12 on windows-latest (push) Blocked by required conditions
CI / Python 3.13 on windows-latest (push) Blocked by required conditions
CI / Python 3.14 on windows-latest (push) Blocked by required conditions
CodeQL Checks / Analyze (python) (push) Waiting to run
Add type annotations across all 'smart' tests, enabling mypy to check test function bodies, catching type errors that were previously hidden.
This commit is contained in:
@@ -9,7 +9,7 @@ brightness = parametrize("brightness smart", component_filter="brightness")
|
||||
|
||||
|
||||
@brightness
|
||||
async def test_brightness_component(dev: SmartDevice):
|
||||
async def test_brightness_component(dev: SmartDevice) -> None:
|
||||
"""Test brightness feature."""
|
||||
brightness = next(get_parent_and_child_modules(dev, "Brightness"))
|
||||
assert brightness
|
||||
@@ -35,7 +35,7 @@ async def test_brightness_component(dev: SmartDevice):
|
||||
|
||||
|
||||
@dimmable_iot
|
||||
async def test_brightness_dimmable(dev: IotDevice):
|
||||
async def test_brightness_dimmable(dev: IotDevice) -> None:
|
||||
"""Test brightness feature."""
|
||||
assert isinstance(dev, IotDevice)
|
||||
assert "brightness" in dev.sys_info or bool(dev.sys_info["is_dimmable"])
|
||||
|
||||
@@ -6,7 +6,7 @@ from ...conftest import variable_temp_smart
|
||||
|
||||
|
||||
@variable_temp_smart
|
||||
async def test_colortemp_component(dev: SmartDevice):
|
||||
async def test_colortemp_component(dev: SmartDevice) -> None:
|
||||
"""Test brightness feature."""
|
||||
assert isinstance(dev, SmartDevice)
|
||||
assert "color_temperature" in dev._components
|
||||
|
||||
Reference in New Issue
Block a user