Skip to content

tests: make the coordinator mocks pass zigpy's type check - #182

Merged
puddly merged 1 commit into
zigpy:devfrom
thomas-roos:fix-zigpy-2.4-coordinator-mocks
Nov 7, 2026
Merged

puddly merged 1 commit into
zigpy:devfrom
thomas-roos:fix-zigpy-2.4-coordinator-mocks

Conversation

@thomas-roos

Copy link
Copy Markdown
Contributor

zigpy 2.4 (b85807eb, "Split up BaseDevice into GreenPowerDevice and
ZigbeeDevice") raises TypeError in ControllerApplication._device unless
the coordinator is a ZigbeeDevice. test_rx, test_rx_nwk_0000 and
test_rx_device_annce return plain MagicMocks from get_device, so they
fail with "Coordinator <MagicMock ...> is not a Zigbee device".

Found while running the zigpy-xbee tests against zigpy 2.4 for the Home Assistant 2026.11 packages of meta-homeassistant (Yocto): meta-homeassistant/meta-homeassistant#207

🤖 Generated with Claude Code

https://claude.ai/code/session_01FimvFQ6GCZWLoFogVCUeAK

zigpy 2.4 (b85807eb, "Split up BaseDevice into GreenPowerDevice and
ZigbeeDevice") raises TypeError in ControllerApplication._device unless
the coordinator is a ZigbeeDevice. test_rx, test_rx_nwk_0000 and
test_rx_device_annce return plain MagicMocks from get_device, so they
fail with "Coordinator <MagicMock ...> is not a Zigbee device".

Signed-off-by: Thomas Roos <thomas@roosesweb.de>
@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1b81d91) to head (1ac2ded).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #182   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          733       733           
=========================================
  Hits           733       733           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@puddly
puddly merged commit e58ebb8 into zigpy:dev Nov 7, 2026
12 checks passed
@puddly

puddly commented Nov 7, 2026

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants