Skip to content

Commit

Permalink
Use typing_extensions Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouwh committed Jun 6, 2024
1 parent 57588c0 commit 9d516dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/components/mqtt/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Test fixtures for mqtt component."""

from collections.abc import Generator
from random import getrandbits
from unittest.mock import AsyncMock, patch

import pytest
from typing_extensions import Generator

from tests.components.light.conftest import mock_light_profiles # noqa: F401

Expand All @@ -21,7 +21,7 @@ def temp_dir_prefix() -> str:


@pytest.fixture
def mock_temp_dir(temp_dir_prefix: str) -> Generator[None, None, str]:
def mock_temp_dir(temp_dir_prefix: str) -> Generator[str]:
"""Mock the certificate temp directory."""
with patch(
# Patch temp dir name to avoid tests fail running in parallel
Expand All @@ -32,7 +32,7 @@ def mock_temp_dir(temp_dir_prefix: str) -> Generator[None, None, str]:


@pytest.fixture
def tag_mock() -> Generator[AsyncMock, None, None]:
def tag_mock() -> Generator[AsyncMock]:
"""Fixture to mock tag."""
with patch("homeassistant.components.tag.async_scan_tag") as mock_tag:
yield mock_tag

0 comments on commit 9d516dd

Please sign in to comment.