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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
204 changed files with 908 additions and 921 deletions

View file

@ -1711,7 +1711,7 @@ async def test_register_entity_service_limited_to_matching_platforms(
}
@pytest.mark.parametrize("update_before_add", (True, False))
@pytest.mark.parametrize("update_before_add", [True, False])
async def test_invalid_entity_id(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture, update_before_add: bool
) -> None:
@ -1738,7 +1738,7 @@ class MockBlockingEntity(MockEntity):
await asyncio.sleep(1000)
@pytest.mark.parametrize("update_before_add", (True, False))
@pytest.mark.parametrize("update_before_add", [True, False])
async def test_setup_entry_with_entities_that_block_forever(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
@ -1784,7 +1784,7 @@ class MockCancellingEntity(MockEntity):
raise asyncio.CancelledError
@pytest.mark.parametrize("update_before_add", (True, False))
@pytest.mark.parametrize("update_before_add", [True, False])
async def test_cancellation_is_not_blocked(
hass: HomeAssistant,
update_before_add: bool,
@ -1813,7 +1813,7 @@ async def test_cancellation_is_not_blocked(
assert full_name not in hass.config.components
@pytest.mark.parametrize("update_before_add", (True, False))
@pytest.mark.parametrize("update_before_add", [True, False])
async def test_two_platforms_add_same_entity(
hass: HomeAssistant, update_before_add: bool
) -> None:
@ -1868,14 +1868,14 @@ class SlowEntity(MockEntity):
@pytest.mark.parametrize(
("has_entity_name", "entity_name", "expected_entity_id"),
(
[
(False, "Entity Blu", "test_domain.entity_blu"),
(False, None, "test_domain.test_qwer"), # Set to <platform>_<unique_id>
(True, "Entity Blu", "test_domain.device_bla_entity_blu"),
(True, None, "test_domain.device_bla"),
),
],
)
@pytest.mark.parametrize("update_before_add", (True, False))
@pytest.mark.parametrize("update_before_add", [True, False])
async def test_entity_name_influences_entity_id(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
@ -1921,15 +1921,15 @@ async def test_entity_name_influences_entity_id(
@pytest.mark.parametrize(
("language", "has_entity_name", "expected_entity_id"),
(
[
("en", False, "test_domain.test_qwer"), # Set to <platform>_<unique_id>
("en", True, "test_domain.device_bla_english_name"),
("sv", True, "test_domain.device_bla_swedish_name"),
# Chinese uses english for entity_id
("cn", True, "test_domain.device_bla_english_name"),
),
],
)
@pytest.mark.parametrize("update_before_add", (True, False))
@pytest.mark.parametrize("update_before_add", [True, False])
async def test_translated_entity_name_influences_entity_id(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
@ -1998,7 +1998,7 @@ async def test_translated_entity_name_influences_entity_id(
@pytest.mark.parametrize(
("language", "has_entity_name", "device_class", "expected_entity_id"),
(
[
("en", False, None, "test_domain.test_qwer"), # Set to <platform>_<unique_id>
(
"en",
@ -2010,7 +2010,7 @@ async def test_translated_entity_name_influences_entity_id(
("sv", True, "test_class", "test_domain.device_bla_swedish_cls"),
# Chinese uses english for entity_id
("cn", True, "test_class", "test_domain.device_bla_english_cls"),
),
],
)
async def test_translated_device_class_name_influences_entity_id(
hass: HomeAssistant,