-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Update pytest to 7.4.1 #96995
Update pytest to 7.4.1 #96995
Conversation
Interesting 🤔 Marking as draft for now. |
Blocked by pytest-dev/pytest#11239 |
7cd9b61
to
b638323
Compare
b638323
to
8579d5f
Compare
@@ -3805,10 +3805,12 @@ def _check_entities() -> int: | |||
async_fire_mqtt_message(hass, "test-topic_manual1", "manual1_intial") | |||
async_fire_mqtt_message(hass, "test-topic_manual3", "manual3_intial") | |||
|
|||
assert (state := hass.states.get("sensor.test_manual1")) is not None |
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.
Out of curiosity, why is this changed?
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.
There is an open bug in pytest assertion rewriter. See pytest-dev/pytest#11239
Tbh I'm not sure if we should update. The intention behind 8579d5f was more to see if CI would pass (it should 🤞🏻). 7.4.0
fixed a lot of deprecation warnings which would appear in Python 3.12. What do you think, should we update now even if :=
in asserts don't work?
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.
Are these the only places where assertions are used using the walrus? I don't think they're that many tbh
Without the walrus the test is better to read imo
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.
Are these the only places where assertions are used using the walrus? I don't think they're that many tbh
AFAIC yes. At least those two files are the only ones with errors during the last CI run.
https://github.com/home-assistant/core/actions/runs/6060843262
What's difficult IMO is that the test case using :=
is normally fine. It's actually an unrelated test case in the same test file that breaks which just happens to use the same name (state
in this case) in an assert. This should really be fixed in pytest.
Without the walrus the test is better to read imo
It depends. I'm probably +0 on this. Somethings can I see the appeal of using assignment expressions.
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.
Opened a PR upstream to fix it: pytest-dev/pytest#11414
Closed in favor of #102744 |
Proposed change
https://docs.pytest.org/en/stable/changelog.html#pytest-7-3-2-2023-06-10
https://docs.pytest.org/en/stable/changelog.html#pytest-7-4-0-2023-06-23
https://docs.pytest.org/en/stable/changelog.html#pytest-7-4-1-2023-09-02
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
.To help with the load of incoming pull requests: