Add missing mock in brother config flow tests (#89354)

This commit is contained in:
epenet 2023-03-08 08:43:07 +01:00 committed by GitHub
parent 58280dc2ec
commit adb4414440
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View 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

View file

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