mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Simplify mock_tts_cache_dir_autouse fixture (#123783)
This commit is contained in:
@@ -43,9 +43,8 @@ BYTES_ONE_SECOND = SAMPLE_RATE * SAMPLE_WIDTH * SAMPLE_CHANNELS
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
class BaseProvider:
|
||||
|
@@ -187,9 +187,8 @@ def set_cloud_prefs_fixture(
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from http import HTTPStatus
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
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)
|
||||
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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@@ -30,9 +30,8 @@ def tts_mutagen_mock_fixture_autouse(tts_mutagen_mock: MagicMock) -> None:
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
@@ -34,9 +34,8 @@ def get_empty_wav() -> bytes:
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
async def test_setup_component(hass: HomeAssistant) -> None:
|
||||
|
@@ -20,9 +20,8 @@ from tests.typing import ClientSessionGenerator
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
@@ -36,9 +36,8 @@ def tts_mutagen_mock_fixture_autouse(tts_mutagen_mock: MagicMock) -> None:
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
async def test_setup_component(hass: HomeAssistant) -> None:
|
||||
|
@@ -19,9 +19,8 @@ _MEDIA_ID = "12345"
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
def _empty_wav() -> bytes:
|
||||
|
@@ -19,9 +19,8 @@ from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
@@ -29,9 +29,8 @@ def tts_mutagen_mock_fixture_autouse(tts_mutagen_mock: MagicMock) -> None:
|
||||
|
||||
|
||||
@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."""
|
||||
return mock_tts_cache_dir
|
||||
|
||||
|
||||
async def test_setup_component(hass: HomeAssistant) -> None:
|
||||
|
Reference in New Issue
Block a user