Add TypeVar default for FlowResult (#112345)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
Erik Montnemery 2024-03-05 22:52:11 +01:00 committed by GitHub
parent 33fe6ad647
commit 3d3e9900c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 77 additions and 81 deletions

View file

@ -24,11 +24,9 @@ def manager():
handlers = Registry()
entries = []
class FlowManager(data_entry_flow.BaseFlowManager):
class FlowManager(data_entry_flow.FlowManager):
"""Test flow manager."""
_flow_result = data_entry_flow.FlowResult
async def async_create_flow(self, handler_key, *, context, data):
"""Test create flow."""
handler = handlers.get(handler_key)
@ -81,7 +79,7 @@ async def test_configure_reuses_handler_instance(manager) -> None:
assert len(manager.mock_created_entries) == 0
async def test_configure_two_steps(manager: data_entry_flow.BaseFlowManager) -> None:
async def test_configure_two_steps(manager: data_entry_flow.FlowManager) -> None:
"""Test that we reuse instances."""
@manager.mock_reg_handler("test")
@ -258,7 +256,7 @@ async def test_finish_callback_change_result_type(hass: HomeAssistant) -> None:
step_id="init", data_schema=vol.Schema({"count": int})
)
class FlowManager(data_entry_flow.BaseFlowManager):
class FlowManager(data_entry_flow.FlowManager):
async def async_create_flow(self, handler_name, *, context, data):
"""Create a test flow."""
return TestFlow()
@ -775,7 +773,7 @@ async def test_async_get_unknown_flow(manager) -> None:
async def test_async_has_matching_flow(
hass: HomeAssistant, manager: data_entry_flow.BaseFlowManager
hass: HomeAssistant, manager: data_entry_flow.FlowManager
) -> None:
"""Test we can check for matching flows."""
manager.hass = hass
@ -951,7 +949,7 @@ async def test_show_menu(hass: HomeAssistant, manager, menu_options) -> None:
async def test_find_flows_by_init_data_type(
manager: data_entry_flow.BaseFlowManager,
manager: data_entry_flow.FlowManager,
) -> None:
"""Test we can find flows by init data type."""