Move mock_setup_entry to conftest (#88484)
This commit is contained in:
parent
ea4d2bd1e8
commit
bf5f7c53d8
18 changed files with 115 additions and 89 deletions
|
@ -2,7 +2,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import MagicMock, create_autospec, patch
|
||||
from unittest.mock import AsyncMock, MagicMock, create_autospec, patch
|
||||
|
||||
from asyncsleepiq import (
|
||||
Side,
|
||||
|
@ -40,6 +40,15 @@ SLEEPIQ_CONFIG = {
|
|||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||
"""Override async_setup_entry."""
|
||||
with patch(
|
||||
"homeassistant.components.sleepiq.async_setup_entry", return_value=True
|
||||
) as mock_setup_entry:
|
||||
yield mock_setup_entry
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_bed() -> MagicMock:
|
||||
"""Mock a SleepIQBed object with sleepers and lights."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue