From d76fb2d8910f410f91438cab13f623e7eb127b89 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Fri, 8 Apr 2022 23:33:24 -0700 Subject: [PATCH] Remove unnecessary async from test fixtures (#69722) --- tests/components/google/conftest.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/components/google/conftest.py b/tests/components/google/conftest.py index 617590cb856..b468762ae8f 100644 --- a/tests/components/google/conftest.py +++ b/tests/components/google/conftest.py @@ -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: