mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Cleanup pylint ignore in melnor tests (#118564)
This commit is contained in:
parent
51933b0f47
commit
6115dffd80
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Generator
|
from collections.abc import Generator
|
||||||
from datetime import UTC, datetime, time, timedelta
|
from datetime import UTC, datetime, time, timedelta
|
||||||
from unittest.mock import AsyncMock, patch
|
from unittest.mock import AsyncMock, _patch, patch
|
||||||
|
|
||||||
from melnor_bluetooth.device import Device
|
from melnor_bluetooth.device import Device
|
||||||
import pytest
|
import pytest
|
||||||
@ -253,10 +253,9 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
|||||||
yield mock_setup
|
yield mock_setup
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=dangerous-default-value
|
|
||||||
def patch_async_discovered_service_info(
|
def patch_async_discovered_service_info(
|
||||||
return_value: list[BluetoothServiceInfoBleak] = [FAKE_SERVICE_INFO_1],
|
return_value: list[BluetoothServiceInfoBleak],
|
||||||
):
|
) -> _patch:
|
||||||
"""Patch async_discovered_service_info a mocked device info."""
|
"""Patch async_discovered_service_info a mocked device info."""
|
||||||
return patch(
|
return patch(
|
||||||
"homeassistant.components.melnor.config_flow.async_discovered_service_info",
|
"homeassistant.components.melnor.config_flow.async_discovered_service_info",
|
||||||
|
@ -40,7 +40,7 @@ async def test_user_step_discovered_devices(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test we properly handle device picking."""
|
"""Test we properly handle device picking."""
|
||||||
|
|
||||||
with patch_async_discovered_service_info():
|
with patch_async_discovered_service_info([FAKE_SERVICE_INFO_1]):
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
context={"source": config_entries.SOURCE_USER},
|
context={"source": config_entries.SOURCE_USER},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user