Fix ty type-check failures in new test files

resolve()/for_device_by_model() return DeviceRegistry | None; four new
test files used reg.capabilities/reg.pattern_capabilities without
narrowing away None first. Add the same 'assert reg is not None' idiom
test_dehumidifier_tp1x_dhm01001_capabilities.py already uses.

Verified against a clean venv running the exact CI commands (ruff format
--check, ruff check, ty check, pytest) rather than trusting a stale local
venv that had picked up a mismatched python3.11/3.13 site-packages split.
This commit is contained in:
Marc Billow committed 2026-08-07 15:52:46 +00:00
1 parent e2dcc75ed5
commit 8551974719
4 files changed
+8

No files matched your search

@@ -19,6 +19,7 @@ from tests.conftest import _load_device
def _bound():
resources = _load_device("gas_cooktop_tp2x_ks")
reg = resolve(resources)
assert reg is not None
return discover(resources, reg.capabilities, reg.pattern_capabilities), resources
@@ -31,6 +32,7 @@ def test_resolves_to_gas_cooktop_registry():
def test_no_unbound_hrefs():
_, resources = _bound()
reg = resolve(resources)
assert reg is not None
unbound = []
discover(resources, reg.capabilities, reg.pattern_capabilities, log=unbound.append)
assert unbound == []