Add missing mock in azure event hub config flow tests (#89355)

pull/89385/head
epenet 2023-03-08 16:16:28 +01:00 committed by GitHub
parent 2ec78ae70e
commit ea6a95176d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -117,7 +117,7 @@ def mock_from_connection_string_fixture():
yield from_conn_string
@pytest.fixture(name="mock_setup_entry")
@pytest.fixture
def mock_setup_entry():
"""Mock the setup entry call, used for config flow tests."""
with patch(

View File

@ -1,5 +1,6 @@
"""Test the AEH config flow."""
import logging
from unittest.mock import AsyncMock
from azure.eventhub.exceptions import EventHubError
import pytest
@ -29,6 +30,8 @@ from tests.common import MockConfigEntry
_LOGGER = logging.getLogger(__name__)
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
@pytest.mark.parametrize(
("step1_config", "step_id", "step2_config", "data_config"),
@ -40,7 +43,7 @@ _LOGGER = logging.getLogger(__name__)
)
async def test_form(
hass: HomeAssistant,
mock_setup_entry,
mock_setup_entry: AsyncMock,
mock_from_connection_string,
step1_config,
step_id,
@ -70,7 +73,7 @@ async def test_form(
mock_setup_entry.assert_called_once()
async def test_import(hass: HomeAssistant, mock_setup_entry) -> None:
async def test_import(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> None:
"""Test we get the form."""
import_config = IMPORT_CONFIG.copy()