Simplify mock_tts_cache_dir_autouse fixture (#123783)

This commit is contained in:
epenet 2024-08-13 18:01:06 +02:00 committed by GitHub
parent 995ed77849
commit ba54a19d4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 11 additions and 20 deletions

View File

@ -43,9 +43,8 @@ BYTES_ONE_SECOND = SAMPLE_RATE * SAMPLE_WIDTH * SAMPLE_CHANNELS
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
class BaseProvider: class BaseProvider:

View File

@ -187,9 +187,8 @@ def set_cloud_prefs_fixture(
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)

View File

@ -3,6 +3,7 @@
from __future__ import annotations from __future__ import annotations
from http import HTTPStatus from http import HTTPStatus
from pathlib import Path
from typing import Any from typing import Any
from unittest.mock import AsyncMock, MagicMock, patch from unittest.mock import AsyncMock, MagicMock, patch
@ -34,9 +35,8 @@ def tts_mutagen_mock_fixture_autouse(tts_mutagen_mock: MagicMock) -> None:
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir): def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
@pytest.fixture @pytest.fixture

View File

@ -30,9 +30,8 @@ def tts_mutagen_mock_fixture_autouse(tts_mutagen_mock: MagicMock) -> None:
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)

View File

@ -34,9 +34,8 @@ def get_empty_wav() -> bytes:
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
async def test_setup_component(hass: HomeAssistant) -> None: async def test_setup_component(hass: HomeAssistant) -> None:

View File

@ -20,9 +20,8 @@ from tests.typing import ClientSessionGenerator
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)

View File

@ -36,9 +36,8 @@ def tts_mutagen_mock_fixture_autouse(tts_mutagen_mock: MagicMock) -> None:
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
async def test_setup_component(hass: HomeAssistant) -> None: async def test_setup_component(hass: HomeAssistant) -> None:

View File

@ -19,9 +19,8 @@ _MEDIA_ID = "12345"
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
def _empty_wav() -> bytes: def _empty_wav() -> bytes:

View File

@ -19,9 +19,8 @@ from tests.common import MockConfigEntry
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)

View File

@ -29,9 +29,8 @@ def tts_mutagen_mock_fixture_autouse(tts_mutagen_mock: MagicMock) -> None:
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> Path: def mock_tts_cache_dir_autouse(mock_tts_cache_dir: Path) -> None:
"""Mock the TTS cache dir with empty dir.""" """Mock the TTS cache dir with empty dir."""
return mock_tts_cache_dir
async def test_setup_component(hass: HomeAssistant) -> None: async def test_setup_component(hass: HomeAssistant) -> None: