Enable Ruff PT013 (#86757)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Franck Nijhof
2023-01-27 09:09:46 +01:00
committed by GitHub
parent bd9a8ba6f1
commit e4a78420b8
50 changed files with 528 additions and 504 deletions

View File

@@ -6,7 +6,6 @@ from decimal import Decimal
from typing import Any
import pytest
from pytest import approx
from homeassistant.components.number import NumberDeviceClass
from homeassistant.components.sensor import (
@@ -1161,12 +1160,12 @@ async def test_unit_conversion_priority_suggested_unit_change(
# Registered entity -> Follow automatic unit conversion the first time the entity was seen
state = hass.states.get(entity0.entity_id)
assert float(state.state) == approx(float(original_value))
assert float(state.state) == pytest.approx(float(original_value))
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == original_unit
# Registered entity -> Follow suggested unit the first time the entity was seen
state = hass.states.get(entity1.entity_id)
assert float(state.state) == approx(float(original_value))
assert float(state.state) == pytest.approx(float(original_value))
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == original_unit
@@ -1228,7 +1227,7 @@ async def test_unit_conversion_priority_legacy_conversion_removed(
await hass.async_block_till_done()
state = hass.states.get(entity0.entity_id)
assert float(state.state) == approx(float(original_value))
assert float(state.state) == pytest.approx(float(original_value))
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == original_unit