Enable Ruff PT012 (#113957)
This commit is contained in:
parent
915658daa1
commit
721b2c2ca8
90 changed files with 341 additions and 429 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue