Add missing mock in brother config flow tests (#89354)
This commit is contained in:
parent
58280dc2ec
commit
adb4414440
2 changed files with 17 additions and 0 deletions
14
tests/components/brother/conftest.py
Normal file
14
tests/components/brother/conftest.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
"""Test fixtures for brother."""
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||
"""Override async_setup_entry."""
|
||||
with patch(
|
||||
"homeassistant.components.brother.async_setup_entry", return_value=True
|
||||
) as mock_setup_entry:
|
||||
yield mock_setup_entry
|
|
@ -3,6 +3,7 @@ import json
|
|||
from unittest.mock import patch
|
||||
|
||||
from brother import SnmpError, UnsupportedModelError
|
||||
import pytest
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components import zeroconf
|
||||
|
@ -15,6 +16,8 @@ from tests.common import MockConfigEntry, load_fixture
|
|||
|
||||
CONFIG = {CONF_HOST: "127.0.0.1", CONF_TYPE: "laser"}
|
||||
|
||||
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||
|
||||
|
||||
async def test_show_form(hass: HomeAssistant) -> None:
|
||||
"""Test that the form is served with no input."""
|
||||
|
|
Loading…
Add table
Reference in a new issue