-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Improve tests for binary sensor template #147657
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
Conversation
Hey there @Petro31, @home-assistant/core, 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the tests for the binary sensor template by adding new test cases for None and error template results, updating type hints, and replacing direct time manipulation with FrozenDateTimeFactory usage.
- Added parametrized tests to cover various state template scenarios
- Updated test function signatures with explicit type hints
- Replaced dt_util time changes with freezer.tick calls for more reliable time simulation
Comments suppressed due to low confidence (1)
tests/components/template/test_binary_sensor.py:276
- The docstring in the 'test_state' function is misleading; update it to reflect that the test validates binary sensor state evaluation based on provided templates.
"""Test the config flow."""
Proposed change
None
template resultType 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: