Add missing mock in airvisual config flow tests (#89359)

This commit is contained in:
epenet 2023-03-08 16:18:07 +01:00 committed by GitHub
parent b61ad43144
commit 959c2205d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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"),