diff --git a/tests/components/azure_event_hub/conftest.py b/tests/components/azure_event_hub/conftest.py index 18f44b10480..1af24d4a6fa 100644 --- a/tests/components/azure_event_hub/conftest.py +++ b/tests/components/azure_event_hub/conftest.py @@ -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( diff --git a/tests/components/azure_event_hub/test_config_flow.py b/tests/components/azure_event_hub/test_config_flow.py index f49f6470a99..8cebbe6fbd4 100644 --- a/tests/components/azure_event_hub/test_config_flow.py +++ b/tests/components/azure_event_hub/test_config_flow.py @@ -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()