fix: what bandit and the remaining lint rules found

- open() raises ConnectionException from the SoCo error (B904), so the
  cause stays attached.
- _check_wired_connection: the except Exception: pass (B110) now logs at
  debug level, so a swallowed failure leaves a trace. A module logger is
  new.
- nosec for the empty password default (B107): a Sonos speaker takes no
  login, the argument exists for NAPALM's constructor signature.
- tests: raise AssertionError instead of assert False (B011).
This commit is contained in:
Christian Manivong committed 2026-10-23 08:57:52 +02:00
1 parent ad69c0e643
commit a6d1d1e597
2 files changed
+9 -4

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ class TestSonosDriver:
mock_soco.side_effect = Exception("Connection refused")
try:
driver.open()
assert False, "Expected ConnectionException"
raise AssertionError("Expected ConnectionException")
except ConnectionException:
pass