Update ruff to 0.12.0 (#147106)

This commit is contained in:
Marc Mueller
2025-06-19 20:39:09 +02:00
committed by GitHub
parent 73d0d87705
commit 2c13c70e12
96 changed files with 291 additions and 427 deletions

View File

@ -683,11 +683,9 @@ async def test_receiving_message_with_non_utf8_topic_gets_logged(
# Local import to avoid processing MQTT modules when running a testcase
# which does not use MQTT.
# pylint: disable-next=import-outside-toplevel
from paho.mqtt.client import MQTTMessage
from paho.mqtt.client import MQTTMessage # noqa: PLC0415
# pylint: disable-next=import-outside-toplevel
from homeassistant.components.mqtt.models import MqttData
from homeassistant.components.mqtt.models import MqttData # noqa: PLC0415
msg = MQTTMessage(topic=b"tasmota/discovery/18FE34E0B760\xcc\x02")
msg.payload = b"Payload"
@ -1001,10 +999,9 @@ async def test_dump_service(
async_fire_time_changed(hass, utcnow() + timedelta(seconds=3))
await hass.async_block_till_done()
writes = mopen.return_value.write.mock_calls
assert len(writes) == 2
assert writes[0][1][0] == "bla/1,test1\n"
assert writes[1][1][0] == "bla/2,test2\n"
writes = mopen.return_value.writelines.mock_calls
assert len(writes) == 1
assert writes[0][1][0] == ["bla/1,test1\n", "bla/2,test2\n"]
async def test_mqtt_ws_remove_discovered_device(