Some tests leave the `kasa` logger at a different level or rename devices
in shared fixture data. Later log assertions and device dump comparisons
then pass or fail depending on the test order.
This PR restores logger levels through `caplog` and renames devices on
copies, so the affected tests pass independently of their order.
In details:
- Use `caplog.set_level` for tests that change the `kasa` logger, and
remove an unused logger override.
- Add an autouse fixture that restores any changed logger levels and
fails the test with a pointer to `caplog.set_level`.
- Rename README devices on deep copies of the fixture data.
- Cover KLAP handshake debug logging explicitly, instead of relying on
an earlier test leaving DEBUG enabled.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Add type annotations (`-> None` return types and parameter types) to
test files in the `tests/cli/`, `tests/protocols/`, and
`tests/smartcam/` directories. This enables mypy to check test function
bodies, catching type errors that were previously hidden.
`ENETUNREACH` is semantically equivalent to `EHOSTUNREACH` (which is
already in `_NO_RETRY_ERRORS`) — both indicate the destination cannot be
reached at the network layer. Retrying immediately will not resolve the
condition.
In containerized environments (e.g., Home Assistant running in Docker
with bridge networking), a single ICMP "Network unreachable" response
can temporarily poison the container's routing cache. The unnecessary
retries reinforce the poisoned cache entry, causing cascading failures
for other devices on the same subnet.
* Transport tests under tests/transports/
* Protocol tests under tests/protocols/
* IOT tests under iot/
* Plus some minor cleanups, most code changes are related to splitting
up smart & iot tests