tests: add type annotations to Smart tests (#1686)
Some checks failed
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled

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:
ZeliardM
2026-07-07 18:11:59 -04:00
committed by GitHub
parent 8840fc395e
commit 88e1c27bd0
30 changed files with 192 additions and 125 deletions

View File

@@ -26,7 +26,7 @@ autooff = parametrize(
)
async def test_autooff_features(
dev: SmartDevice, feature: str, prop_name: str, type: type
):
) -> None:
"""Test that features are registered and work as expected."""
autooff = next(get_parent_and_child_modules(dev, Module.AutoOff))
assert autooff is not None
@@ -40,7 +40,7 @@ async def test_autooff_features(
@autooff
async def test_settings(dev: SmartDevice, mocker: MockerFixture):
async def test_settings(dev: SmartDevice, mocker: MockerFixture) -> None:
"""Test autooff settings."""
autooff = next(get_parent_and_child_modules(dev, Module.AutoOff))
assert autooff
@@ -79,7 +79,7 @@ async def test_settings(dev: SmartDevice, mocker: MockerFixture):
@pytest.mark.parametrize("is_timer_active", [True, False])
async def test_auto_off_at(
dev: SmartDevice, mocker: MockerFixture, is_timer_active: bool
):
) -> None:
"""Test auto-off at sensor."""
autooff = next(get_parent_and_child_modules(dev, Module.AutoOff))
assert autooff