mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
Enable Ruff PT013 (#86757)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user