mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +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)
|
||||
async def mock_calendars_yaml(
|
||||
def mock_calendars_yaml(
|
||||
hass: HomeAssistant,
|
||||
calendars_config: list[dict[str, Any]],
|
||||
) -> None:
|
||||
@ -126,7 +126,7 @@ class FakeStorage:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def token_scopes() -> list[str]:
|
||||
def token_scopes() -> list[str]:
|
||||
"""Fixture for scopes used during test."""
|
||||
return ["https://www.googleapis.com/auth/calendar"]
|
||||
|
||||
@ -155,7 +155,7 @@ def creds(
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
async def storage() -> YieldFixture[FakeStorage]:
|
||||
def storage() -> YieldFixture[FakeStorage]:
|
||||
"""Fixture to populate an existing token file for read on startup."""
|
||||
storage = FakeStorage()
|
||||
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
|
||||
async def config_entry(
|
||||
def config_entry(
|
||||
token_scopes: list[str], config_entry_token_expiry: float
|
||||
) -> MockConfigEntry:
|
||||
"""Fixture to create a config entry for the integration."""
|
||||
@ -189,7 +189,7 @@ async def config_entry(
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def mock_token_read(
|
||||
def mock_token_read(
|
||||
hass: HomeAssistant,
|
||||
creds: OAuth2Credentials,
|
||||
storage: FakeStorage,
|
||||
@ -282,15 +282,13 @@ def google_config(google_config_track_new: bool | None) -> dict[str, Any]:
|
||||
|
||||
|
||||
@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."""
|
||||
return {DOMAIN: google_config}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def component_setup(
|
||||
hass: HomeAssistant, config: dict[str, Any]
|
||||
) -> ComponentSetup:
|
||||
def component_setup(hass: HomeAssistant, config: dict[str, Any]) -> ComponentSetup:
|
||||
"""Fixture for setting up the integration."""
|
||||
|
||||
async def _setup_func() -> bool:
|
||||
|
Loading…
x
Reference in New Issue
Block a user