Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from homeassistant.data_entry_flow import FlowResultType


@pytest.fixture(autouse=True, name="mock_setup_entry")
def override_async_setup_entry() -> Generator[AsyncMock, None, None]:
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.NEW_DOMAIN.async_setup_entry", return_value=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from tests.common import MockConfigEntry


@pytest.fixture(autouse=True, name="mock_setup_entry")
def override_async_setup_entry() -> Generator[AsyncMock, None, None]:
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.NEW_DOMAIN.async_setup_entry", return_value=True
Expand Down
7 changes: 4 additions & 3 deletions tests/components/nibe_heatpump/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test the Nibe Heat Pump config flow."""
from unittest.mock import Mock, patch
from collections.abc import Generator
from unittest.mock import AsyncMock, Mock, patch

from nibe.coil import Coil
from nibe.exceptions import (
Expand Down Expand Up @@ -32,8 +33,8 @@
}


@pytest.fixture(autouse=True, name="mock_setup_entry")
async def fixture_mock_setup():
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Make sure we never actually run setup."""
with patch(
"homeassistant.components.nibe_heatpump.async_setup_entry", return_value=True
Expand Down
4 changes: 2 additions & 2 deletions tests/components/onewire/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from .const import MOCK_OWPROXY_DEVICES


@pytest.fixture(autouse=True, name="mock_setup_entry")
def override_async_setup_entry() -> Generator[AsyncMock, None, None]:
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.onewire.async_setup_entry", return_value=True
Expand Down
7 changes: 4 additions & 3 deletions tests/components/philips_js/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test the Philips TV config flow."""
from unittest.mock import ANY, patch
from collections.abc import Generator
from unittest.mock import ANY, AsyncMock, patch

from haphilipsjs import PairingFailure
import pytest
Expand All @@ -20,8 +21,8 @@
from tests.common import MockConfigEntry


@pytest.fixture(autouse=True, name="mock_setup_entry")
def mock_setup_entry_fixture():
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Disable component setup."""
with patch(
"homeassistant.components.philips_js.async_setup_entry", return_value=True
Expand Down
5 changes: 3 additions & 2 deletions tests/components/renault/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the Renault config flow."""
from collections.abc import Generator
from unittest.mock import AsyncMock, PropertyMock, patch

import pytest
Expand All @@ -22,8 +23,8 @@
from tests.common import load_fixture


@pytest.fixture(autouse=True, name="mock_setup_entry")
def override_async_setup_entry() -> AsyncMock:
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.renault.async_setup_entry", return_value=True
Expand Down
4 changes: 2 additions & 2 deletions tests/components/samsungtv/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@
}


@pytest.fixture(autouse=True, name="mock_setup_entry")
def override_async_setup_entry() -> Generator[AsyncMock, None, None]:
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.samsungtv.async_setup_entry", return_value=True
Expand Down
4 changes: 2 additions & 2 deletions tests/components/sfr_box/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from tests.common import load_fixture


@pytest.fixture(autouse=True, name="mock_setup_entry")
def override_async_setup_entry() -> Generator[AsyncMock, None, None]:
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.sfr_box.async_setup_entry", return_value=True
Expand Down
4 changes: 2 additions & 2 deletions tests/components/sleepiq/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from .conftest import SLEEPIQ_CONFIG, setup_platform


@pytest.fixture(autouse=True, name="mock_setup_entry")
def override_async_setup_entry() -> Generator[AsyncMock, None, None]:
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.sleepiq.async_setup_entry", return_value=True
Expand Down