mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add missing mock in airvisual config flow tests (#89359)
This commit is contained in:
parent
b61ad43144
commit
959c2205d5
@ -1,4 +1,5 @@
|
||||
"""Define test fixtures for AirVisual."""
|
||||
from collections.abc import Generator
|
||||
import json
|
||||
from unittest.mock import AsyncMock, Mock, patch
|
||||
|
||||
@ -141,3 +142,12 @@ async def setup_config_entry_fixture(hass, config_entry, mock_pyairvisual):
|
||||
"""Define a fixture to set up airvisual."""
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||
"""Override async_setup_entry."""
|
||||
with patch(
|
||||
"homeassistant.components.airvisual.async_setup_entry", return_value=True
|
||||
) as mock_setup_entry:
|
||||
yield mock_setup_entry
|
||||
|
@ -32,6 +32,8 @@ from .conftest import (
|
||||
TEST_STATE,
|
||||
)
|
||||
|
||||
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("integration_type", "input_form_step", "patched_method", "config", "entry_title"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user