-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Statistics refactor testcases in async pytest style #60935
Statistics refactor testcases in async pytest style #60935
Conversation
Hey there @fabaff, mind taking a look at this pull request as it has been labeled with an integration ( |
@emontnemery @MartinHjelmare I'm struggling to get the testcases linked to the recorder to work. I suppose I need to use Please ignore changes to |
There's a helper |
@emontnemery thanks for your help. Ready for review, don't hold back to suggest improvements to the general method |
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.
Let's try to clean up the excessive use of await hass.async_block_till_done()
to make sure we don't hide bugs.
If the tests don't pass unless we call await hass.async_block_till_done()
in the loops with state updates there may be something wrong with the statistics sensor.
I commented on the first few occasions, but the pattern seems to be repeated.
Also, please restore the order of the test cases to make the PR easier to review.
Reordering of the tests can be done in a follow-up if that's called for 👍
Agree. I pretty much inherited these Original order restored, even though that doesn't help GitHub or delta to understand the changes :) Best! |
Thanks a lot! It doesn't help in github, but it helps a lot in external tools. |
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, @ThomDietrich 👍
Proposed change
As discussed in #59205 (comment)
Type of change
Additional information
Checklist
black --fast 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
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: