mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-07-08 23:01:54 +00:00
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
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:
@@ -21,7 +21,7 @@ consumables = parametrize(
|
||||
"consumable_name", [consumable.id for consumable in CONSUMABLE_METAS]
|
||||
)
|
||||
@pytest.mark.parametrize("postfix", ["used", "remaining"])
|
||||
async def test_features(dev: SmartDevice, consumable_name: str, postfix: str):
|
||||
async def test_features(dev: SmartDevice, consumable_name: str, postfix: str) -> None:
|
||||
"""Test that features are registered and work as expected."""
|
||||
consumables = next(get_parent_and_child_modules(dev, Module.Consumables))
|
||||
assert consumables is not None
|
||||
@@ -39,7 +39,7 @@ async def test_features(dev: SmartDevice, consumable_name: str, postfix: str):
|
||||
)
|
||||
async def test_erase(
|
||||
dev: SmartDevice, mocker: MockerFixture, consumable_name: str, data_key: str
|
||||
):
|
||||
) -> None:
|
||||
"""Test autocollection switch."""
|
||||
consumables = next(get_parent_and_child_modules(dev, Module.Consumables))
|
||||
call = mocker.spy(consumables, "call")
|
||||
|
||||
Reference in New Issue
Block a user