From c70cfbb535b9980468b8d96bf5664025ddebb614 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 12 Jun 2024 12:25:29 +0200 Subject: [PATCH] Fix arguments-renamed pylint warning in tests (#119473) --- tests/common.py | 6 +++--- tests/components/config/test_config_entries.py | 2 +- tests/components/intent/test_init.py | 11 ++++++----- tests/components/nest/common.py | 4 ++-- tests/helpers/test_llm.py | 4 +--- tests/test_config_entries.py | 2 +- tests/test_data_entry_flow.py | 2 +- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/tests/common.py b/tests/common.py index 2606b510430..ff1fea9cbda 100644 --- a/tests/common.py +++ b/tests/common.py @@ -413,10 +413,10 @@ def async_mock_intent(hass, intent_typ): class MockIntentHandler(intent.IntentHandler): intent_type = intent_typ - async def async_handle(self, intent): + async def async_handle(self, intent_obj): """Handle the intent.""" - intents.append(intent) - return intent.create_response() + intents.append(intent_obj) + return intent_obj.create_response() intent.async_register(hass, MockIntentHandler()) diff --git a/tests/components/config/test_config_entries.py b/tests/components/config/test_config_entries.py index 17cc7d8c6de..95ff87c2beb 100644 --- a/tests/components/config/test_config_entries.py +++ b/tests/components/config/test_config_entries.py @@ -705,7 +705,7 @@ async def test_get_progress_index( class TestFlow(core_ce.ConfigFlow): VERSION = 5 - async def async_step_hassio(self, info): + async def async_step_hassio(self, discovery_info): return await self.async_step_account() async def async_step_account(self, user_input=None): diff --git a/tests/components/intent/test_init.py b/tests/components/intent/test_init.py index 95d1ee78538..09128681b9e 100644 --- a/tests/components/intent/test_init.py +++ b/tests/components/intent/test_init.py @@ -29,15 +29,16 @@ async def test_http_handle_intent( intent_type = "OrderBeer" - async def async_handle(self, intent): + async def async_handle(self, intent_obj): """Handle the intent.""" - assert intent.context.user_id == hass_admin_user.id - response = intent.create_response() + assert intent_obj.context.user_id == hass_admin_user.id + response = intent_obj.create_response() response.async_set_speech( - "I've ordered a {}!".format(intent.slots["type"]["value"]) + "I've ordered a {}!".format(intent_obj.slots["type"]["value"]) ) response.async_set_card( - "Beer ordered", "You chose a {}.".format(intent.slots["type"]["value"]) + "Beer ordered", + "You chose a {}.".format(intent_obj.slots["type"]["value"]), ) return response diff --git a/tests/components/nest/common.py b/tests/components/nest/common.py index d4eec5ae592..693fcae5b87 100644 --- a/tests/components/nest/common.py +++ b/tests/components/nest/common.py @@ -97,9 +97,9 @@ class FakeSubscriber(GoogleNestSubscriber): """Initialize Fake Subscriber.""" self._device_manager = DeviceManager() - def set_update_callback(self, callback: Callable[[EventMessage], Awaitable[None]]): + def set_update_callback(self, target: Callable[[EventMessage], Awaitable[None]]): """Capture the callback set by Home Assistant.""" - self._device_manager.set_update_callback(callback) + self._device_manager.set_update_callback(target) async def create_subscription(self): """Create the subscription.""" diff --git a/tests/helpers/test_llm.py b/tests/helpers/test_llm.py index 6ac17a2fe0e..17a0ef0e73e 100644 --- a/tests/helpers/test_llm.py +++ b/tests/helpers/test_llm.py @@ -49,9 +49,7 @@ async def test_register_api(hass: HomeAssistant, llm_context: llm.LLMContext) -> """Test registering an llm api.""" class MyAPI(llm.API): - async def async_get_api_instance( - self, tool_context: llm.ToolInput - ) -> llm.APIInstance: + async def async_get_api_instance(self, _: llm.ToolInput) -> llm.APIInstance: """Return a list of tools.""" return llm.APIInstance(self, "", [], llm_context) diff --git a/tests/test_config_entries.py b/tests/test_config_entries.py index 2d946dd1fce..d410cb4568a 100644 --- a/tests/test_config_entries.py +++ b/tests/test_config_entries.py @@ -4879,7 +4879,7 @@ async def test_preview_not_supported( VERSION = 1 - async def async_step_user(self, data): + async def async_step_user(self, user_input): """Mock Reauth.""" return self.async_show_form(step_id="user_confirm") diff --git a/tests/test_data_entry_flow.py b/tests/test_data_entry_flow.py index 11e36e8f718..cc12ae42b67 100644 --- a/tests/test_data_entry_flow.py +++ b/tests/test_data_entry_flow.py @@ -260,7 +260,7 @@ async def test_finish_callback_change_result_type(hass: HomeAssistant) -> None: ) class FlowManager(data_entry_flow.FlowManager): - async def async_create_flow(self, handler_name, *, context, data): + async def async_create_flow(self, handler_key, *, context, data): """Create a test flow.""" return TestFlow()