Refactor Vizio tests: shared fixtures, snapshot_platform, reduced parametrize#167935
Merged
joostlek merged 5 commits intohome-assistant:devfrom Apr 10, 2026
Merged
Refactor Vizio tests: shared fixtures, snapshot_platform, reduced parametrize#167935joostlek merged 5 commits intohome-assistant:devfrom
joostlek merged 5 commits intohome-assistant:devfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… reduce parametrize Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d snapshot_platform Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Vizio integration test suite to reduce duplication and improve coverage/readability by centralizing config-entry setup and using snapshot-based entity assertions.
Changes:
- Added shared
MockConfigEntryfixtures and asetup_integrationhelper intests/components/vizio/conftest.py. - Introduced snapshot-based entity setup tests for the
remoteandmedia_playerplatforms (with platform-limiting fixtures to satisfysnapshot_platformconstraints). - Simplified/trimmed remote command parametrization while preserving representative and case-insensitivity coverage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/components/vizio/conftest.py |
Adds shared TV/speaker config entry fixtures and a helper to set up the integration consistently. |
tests/components/vizio/test_remote.py |
Uses shared fixtures/helper; adds snapshot-based setup test and limits loaded platforms to remote for snapshots. |
tests/components/vizio/test_media_player.py |
Uses shared fixtures/helper; adds snapshot-based setup test and limits loaded platforms to media_player for snapshots. |
tests/components/vizio/test_init.py |
Refactors setup to use shared helper/fixtures, keeping existing assertions intact. |
tests/components/vizio/snapshots/test_remote.ambr |
Adds snapshots for remote entity registry entry + state. |
tests/components/vizio/snapshots/test_media_player.ambr |
Adds snapshots for media_player entity registry entry + state. |
joostlek
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Refactors Vizio integration tests to address review comments from #165820:
mock_tv_config_entryandmock_speaker_config_entryfixtures plus asetup_integrationhelper, eliminating duplicatedMockConfigEntrycreation acrosstest_remote.py,test_media_player.py, andtest_init.pysnapshot_platform: Added snapshot-based entity setup tests for both remote and media_player platforms, capturing complete entity state + registry entries instead of manual 2-3 field assertionsType of change
Additional information
Checklist
ruff format homeassistant tests)To help with the load of incoming pull requests: