Repository navigation
Remove stale xfail in hdmi_cec switch status test - #180532
Conversation
test_device_status_change used the imperative pytest.xfail(), which aborts the test before the assertion instead of running it and reporting XPASS. The underlying bug was fixed by the async migration in #168306, which removed the two equivalent markers from test_media_player.py because they started passing. This one stayed because it can never report a pass. All 16 parameter sets pass with the guard removed.
There was a problem hiding this comment.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
Hey there @inytar, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
Removes a stale imperative xfail so all switch status cases execute their assertions.
Changes:
- Removes the obsolete conditional
pytest.xfail. - Enables six previously skipped parameter sets.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| " instead of `true` as expected." | ||
| ) | ||
| ) | ||
| assert state.state == expected_state |
Proposed change
test_device_status_changein the hdmi_cec switch tests guards six of itssixteen parameter sets with the imperative
pytest.xfail():The imperative form aborts the test on the spot, so the assertion below it
never runs. Unlike
pytest.mark.xfailit cannot report XPASS, which means itkeeps reporting xfailed whether or not the bug is still there.
The bug is gone. It was fixed by the async migration in #168306, which turned
CecSwitchEntity.updateintoasync_update. That same PR removed twopytest.mark.xfailmarkers fromtest_media_player.pybecause they startedpassing and showed up as XPASS. This one was left behind because it never
could.
Removing the guard lets all sixteen parameter sets assert, and they all pass.
Only one other imperative
pytest.xfail()exists in the test suite,in
tests/pylint/test_determinism.py, where it is the intended behaviour of aself-test. So this is the only stale one.
Type of change
Additional information
pytest tests/components/hdmi_cec/before this change: 102 passed, 23 xfailed.After: 108 passed, 17 xfailed, no failures. Stable across repeated randomised
runs.
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: