diff --git a/tests/components/bluetooth/test_models.py b/tests/components/bluetooth/test_models.py index 820fa734f73..d36741b4d5d 100644 --- a/tests/components/bluetooth/test_models.py +++ b/tests/components/bluetooth/test_models.py @@ -107,6 +107,7 @@ async def test_wrapped_bleak_client_local_adapter_only(hass: HomeAssistant) -> N "00:00:00:00:00:01", "hci0", ) + # pylint: disable-next=attribute-defined-outside-init scanner.connectable = True cancel = manager.async_register_scanner(scanner) inject_advertisement_with_source( diff --git a/tests/components/harmony/conftest.py b/tests/components/harmony/conftest.py index 97449749667..1e6bbd7a3c3 100644 --- a/tests/components/harmony/conftest.py +++ b/tests/components/harmony/conftest.py @@ -50,6 +50,7 @@ class FakeHarmonyClient: self, ip_address: str = "", callbacks: ClientCallbackType = MagicMock() ): """Initialize FakeHarmonyClient class to capture callbacks.""" + # pylint: disable=attribute-defined-outside-init self._activity_name = "Watch TV" self.close = AsyncMock() self.send_commands = AsyncMock() diff --git a/tests/components/network/test_init.py b/tests/components/network/test_init.py index e57b3242e8c..57a12868d0a 100644 --- a/tests/components/network/test_init.py +++ b/tests/components/network/test_init.py @@ -36,6 +36,7 @@ def _mock_cond_socket(sockname): class CondMockSock(MagicMock): def connect(self, addr): """Mock connect that stores addr.""" + # pylint: disable-next=attribute-defined-outside-init self._addr = addr[0] def getsockname(self): diff --git a/tests/components/sonos/conftest.py b/tests/components/sonos/conftest.py index bfece59ff9c..478443fff76 100644 --- a/tests/components/sonos/conftest.py +++ b/tests/components/sonos/conftest.py @@ -467,6 +467,7 @@ def music_library_fixture( def alarm_clock_fixture(): """Create alarmClock fixture.""" alarm_clock = SonosMockService("AlarmClock") + # pylint: disable-next=attribute-defined-outside-init alarm_clock.ListAlarms = Mock() alarm_clock.ListAlarms.return_value = { "CurrentAlarmListVersion": "RINCON_test:14", @@ -484,6 +485,7 @@ def alarm_clock_fixture(): def alarm_clock_fixture_extended(): """Create alarmClock fixture.""" alarm_clock = SonosMockService("AlarmClock") + # pylint: disable-next=attribute-defined-outside-init alarm_clock.ListAlarms = Mock() alarm_clock.ListAlarms.return_value = { "CurrentAlarmListVersion": "RINCON_test:15", diff --git a/tests/components/yeelight/__init__.py b/tests/components/yeelight/__init__.py index 6c940b0b229..8dc2acef416 100644 --- a/tests/components/yeelight/__init__.py +++ b/tests/components/yeelight/__init__.py @@ -132,6 +132,7 @@ class MockAsyncBulb: def _mocked_bulb(cannot_connect=False): + # pylint: disable=attribute-defined-outside-init bulb = MockAsyncBulb(MODEL, BulbType.Color, cannot_connect) type(bulb).async_get_properties = AsyncMock( side_effect=BulbException if cannot_connect else None diff --git a/tests/helpers/test_entity.py b/tests/helpers/test_entity.py index d105ffad791..a8524d73a5d 100644 --- a/tests/helpers/test_entity.py +++ b/tests/helpers/test_entity.py @@ -107,6 +107,7 @@ async def test_async_update_support(hass: HomeAssistant) -> None: """Async update.""" async_update.append(1) + # pylint: disable-next=attribute-defined-outside-init ent.async_update = async_update_func await ent.async_update_ha_state(True) diff --git a/tests/helpers/test_entity_platform.py b/tests/helpers/test_entity_platform.py index 55b5d98fd30..986c3e5493e 100644 --- a/tests/helpers/test_entity_platform.py +++ b/tests/helpers/test_entity_platform.py @@ -94,8 +94,10 @@ async def test_polling_check_works_if_entity_add_fails( return self.hass.data is not None working_poll_ent = MockEntityNeedsSelfHassInShouldPoll(should_poll=True) + # pylint: disable-next=attribute-defined-outside-init working_poll_ent.async_update = AsyncMock() broken_poll_ent = MockEntityNeedsSelfHassInShouldPoll(should_poll=True) + # pylint: disable-next=attribute-defined-outside-init broken_poll_ent.async_update = AsyncMock(side_effect=Exception("Broken")) await component.async_add_entities( diff --git a/tests/helpers/test_schema_config_entry_flow.py b/tests/helpers/test_schema_config_entry_flow.py index 4db56a91c11..877e3762d3b 100644 --- a/tests/helpers/test_schema_config_entry_flow.py +++ b/tests/helpers/test_schema_config_entry_flow.py @@ -68,7 +68,9 @@ def manager_fixture(): return result mgr = FlowManager(None) + # pylint: disable-next=attribute-defined-outside-init mgr.mock_created_entries = entries + # pylint: disable-next=attribute-defined-outside-init mgr.mock_reg_handler = handlers.register return mgr diff --git a/tests/test_data_entry_flow.py b/tests/test_data_entry_flow.py index 312e2be7602..11e36e8f718 100644 --- a/tests/test_data_entry_flow.py +++ b/tests/test_data_entry_flow.py @@ -47,7 +47,9 @@ def manager(): return result mgr = FlowManager(None) + # pylint: disable-next=attribute-defined-outside-init mgr.mock_created_entries = entries + # pylint: disable-next=attribute-defined-outside-init mgr.mock_reg_handler = handlers.register return mgr