New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use MockConfigEntry
in hue tests
#117237
Use MockConfigEntry
in hue tests
#117237
Conversation
Hey there @balloob, @marcelveldt, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@@ -49,11 +50,8 @@ | |||
|
|||
async def test_hue_activate_scene(hass: HomeAssistant, mock_api_v1) -> None: | |||
"""Test successful hue_activate_scene.""" | |||
config_entry = config_entries.ConfigEntry( | |||
version=1, | |||
minor_version=1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're losing out on minor_version=1
, does that matter ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the default, it was only added because ConfigEntry
requires passing the minor version, the point of this PR is to not have to update the hue
tests when we make changes to config entries.
config_entry = config_entries.ConfigEntry( | ||
version=1, | ||
minor_version=1, | ||
config_entry = MockConfigEntry( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this can be a fixture? It's all the same .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess. The point of this PR is not really to improve the hue tests though, it's to not have to change hue tests when there are unrelated changes.
OK to merge as is, or do you want a fixture?
Proposed change
Use
MockConfigEntry
in hue testsType of change
Additional information
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
..coveragerc
.To help with the load of incoming pull requests: