Enable Ruff PT012 (#113957)

This commit is contained in:
Sid 2024-06-08 17:59:08 +02:00 committed by GitHub
parent 915658daa1
commit 721b2c2ca8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
90 changed files with 341 additions and 429 deletions

View file

@ -1088,9 +1088,9 @@ async def test_set_preset_mode_optimistic(
state = hass.states.get(ENTITY_CLIMATE)
assert state.attributes.get("preset_mode") == "comfort"
with pytest.raises(ServiceValidationError):
with pytest.raises(ServiceValidationError) as excinfo:
await common.async_set_preset_mode(hass, "invalid", ENTITY_CLIMATE)
assert "'invalid' is not a valid preset mode" in caplog.text
assert "Preset mode invalid is not valid." in str(excinfo.value)
@pytest.mark.parametrize(
@ -1146,9 +1146,9 @@ async def test_set_preset_mode_explicit_optimistic(
state = hass.states.get(ENTITY_CLIMATE)
assert state.attributes.get("preset_mode") == "comfort"
with pytest.raises(ServiceValidationError):
with pytest.raises(ServiceValidationError) as excinfo:
await common.async_set_preset_mode(hass, "invalid", ENTITY_CLIMATE)
assert "'invalid' is not a valid preset mode" in caplog.text
assert "Preset mode invalid is not valid." in str(excinfo.value)
@pytest.mark.parametrize(