Move mock_setup_entry to conftest (#88484)

This commit is contained in:
epenet 2023-03-06 11:31:50 +01:00 committed by GitHub
parent ea4d2bd1e8
commit bf5f7c53d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 115 additions and 89 deletions

View file

@ -1,7 +1,7 @@
"""Fixtures for Samsung TV."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from collections.abc import Awaitable, Callable, Generator
from datetime import datetime
from socket import AddressFamily
from typing import Any
@ -25,6 +25,15 @@ import homeassistant.util.dt as dt_util
from .const import SAMPLE_DEVICE_INFO_UE48JU6400, SAMPLE_DEVICE_INFO_WIFI
@pytest.fixture
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.samsungtv.async_setup_entry", return_value=True
) as mock_setup_entry:
yield mock_setup_entry
@pytest.fixture(autouse=True)
async def silent_ssdp_scanner(hass):
"""Start SSDP component and get Scanner, prevent actual SSDP traffic."""