-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Cleanup zwave_js fixture definitions #125896
Cleanup zwave_js fixture definitions #125896
Conversation
Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@@ -1002,39 +1022,39 @@ def climate_radio_thermostat_ct100_mode_and_setpoint_on_different_endpoints_fixt | |||
|
|||
|
|||
@pytest.fixture(name="vision_security_zl7432") | |||
def vision_security_zl7432_fixture(client, vision_security_zl7432_state): | |||
def vision_security_zl7432_fixture(client, vision_security_zl7432_state) -> Node: |
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.
If you feel fancy, we could also look into typing the parameters
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.
Not today :)
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
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.
Thanks!
MockConfigEntry, | ||
load_json_array_fixture, | ||
load_json_object_fixture, | ||
) | ||
|
||
# State fixtures | ||
|
||
|
||
@pytest.fixture(name="controller_state", scope="package") |
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.
In the future we can probably drop the package scope, since load_fixture
already caches the return values. Then we can also remove the deepcopy
of the data when creating the nodes.
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.
Oh really? I've been told multiple times that I need to separate the fixture and add a scope to it to make sure we don't have to load every time
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.
Yeah, that's what I normally do. But since we have a cache on the function that reads from disk it may not be needed. Would be good to do some performance testing though to check what is faster.
* refactor: cleanup zwave_js fixture definitions * fix: that one fixture that's not an object * fix: some more forgotten ones
Breaking change
Proposed change
Implements the changes to zwave_js fixtures @joostlek requested in #125827
Type 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
.To help with the load of incoming pull requests: