Enable Ruff rule PT007 (#113764)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Sid
2024-03-19 09:01:07 +01:00
committed by GitHub
parent 089a3ab6d7
commit 00ec7f11f0
204 changed files with 908 additions and 921 deletions

View File

@@ -337,7 +337,7 @@ def test_get_unit_system_invalid(key: str) -> None:
@pytest.mark.parametrize(
("device_class", "original_unit", "state_unit"),
(
[
# Test atmospheric pressure
(
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
@@ -477,7 +477,7 @@ def test_get_unit_system_invalid(key: str) -> None:
UnitOfSpeed.KILOMETERS_PER_HOUR,
),
(SensorDeviceClass.WIND_SPEED, "very_fast", None),
),
],
)
def test_get_metric_converted_unit_(
device_class: SensorDeviceClass,
@@ -537,7 +537,7 @@ UNCONVERTED_UNITS_METRIC_SYSTEM = {
@pytest.mark.parametrize(
"device_class",
(
[
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
SensorDeviceClass.DISTANCE,
SensorDeviceClass.GAS,
@@ -547,7 +547,7 @@ UNCONVERTED_UNITS_METRIC_SYSTEM = {
SensorDeviceClass.SPEED,
SensorDeviceClass.VOLUME,
SensorDeviceClass.WATER,
),
],
)
def test_metric_converted_units(device_class: SensorDeviceClass) -> None:
"""Test unit conversion rules are in place for all units."""
@@ -565,7 +565,7 @@ def test_metric_converted_units(device_class: SensorDeviceClass) -> None:
@pytest.mark.parametrize(
("device_class", "original_unit", "state_unit"),
(
[
# Test atmospheric pressure
(
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
@@ -697,7 +697,7 @@ def test_metric_converted_units(device_class: SensorDeviceClass) -> None:
(SensorDeviceClass.WIND_SPEED, UnitOfSpeed.KNOTS, None),
(SensorDeviceClass.WIND_SPEED, UnitOfSpeed.MILES_PER_HOUR, None),
(SensorDeviceClass.WIND_SPEED, "very_fast", None),
),
],
)
def test_get_us_converted_unit(
device_class: SensorDeviceClass,
@@ -748,7 +748,7 @@ UNCONVERTED_UNITS_US_SYSTEM = {
@pytest.mark.parametrize(
"device_class",
(
[
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
SensorDeviceClass.DISTANCE,
SensorDeviceClass.GAS,
@@ -758,7 +758,7 @@ UNCONVERTED_UNITS_US_SYSTEM = {
SensorDeviceClass.SPEED,
SensorDeviceClass.VOLUME,
SensorDeviceClass.WATER,
),
],
)
def test_imperial_converted_units(device_class: SensorDeviceClass) -> None:
"""Test unit conversion rules are in place for all units."""