mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Remove unnecessary async from test fixtures (#69722)
This commit is contained in:
parent
6d17f4ffff
commit
d76fb2d891
@ -99,7 +99,7 @@ def calendars_config(calendars_config_entity: dict[str, Any]) -> list[dict[str,
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
async def mock_calendars_yaml(
|
def mock_calendars_yaml(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
calendars_config: list[dict[str, Any]],
|
calendars_config: list[dict[str, Any]],
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -126,7 +126,7 @@ class FakeStorage:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def token_scopes() -> list[str]:
|
def token_scopes() -> list[str]:
|
||||||
"""Fixture for scopes used during test."""
|
"""Fixture for scopes used during test."""
|
||||||
return ["https://www.googleapis.com/auth/calendar"]
|
return ["https://www.googleapis.com/auth/calendar"]
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ def creds(
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
async def storage() -> YieldFixture[FakeStorage]:
|
def storage() -> YieldFixture[FakeStorage]:
|
||||||
"""Fixture to populate an existing token file for read on startup."""
|
"""Fixture to populate an existing token file for read on startup."""
|
||||||
storage = FakeStorage()
|
storage = FakeStorage()
|
||||||
with patch("homeassistant.components.google.Storage", return_value=storage):
|
with patch("homeassistant.components.google.Storage", return_value=storage):
|
||||||
@ -169,7 +169,7 @@ def config_entry_token_expiry(token_expiry: datetime.datetime) -> float:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def config_entry(
|
def config_entry(
|
||||||
token_scopes: list[str], config_entry_token_expiry: float
|
token_scopes: list[str], config_entry_token_expiry: float
|
||||||
) -> MockConfigEntry:
|
) -> MockConfigEntry:
|
||||||
"""Fixture to create a config entry for the integration."""
|
"""Fixture to create a config entry for the integration."""
|
||||||
@ -189,7 +189,7 @@ async def config_entry(
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def mock_token_read(
|
def mock_token_read(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
creds: OAuth2Credentials,
|
creds: OAuth2Credentials,
|
||||||
storage: FakeStorage,
|
storage: FakeStorage,
|
||||||
@ -282,15 +282,13 @@ def google_config(google_config_track_new: bool | None) -> dict[str, Any]:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def config(google_config: dict[str, Any]) -> dict[str, Any]:
|
def config(google_config: dict[str, Any]) -> dict[str, Any]:
|
||||||
"""Fixture for overriding component config."""
|
"""Fixture for overriding component config."""
|
||||||
return {DOMAIN: google_config}
|
return {DOMAIN: google_config}
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def component_setup(
|
def component_setup(hass: HomeAssistant, config: dict[str, Any]) -> ComponentSetup:
|
||||||
hass: HomeAssistant, config: dict[str, Any]
|
|
||||||
) -> ComponentSetup:
|
|
||||||
"""Fixture for setting up the integration."""
|
"""Fixture for setting up the integration."""
|
||||||
|
|
||||||
async def _setup_func() -> bool:
|
async def _setup_func() -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user