Simplify time zone setting in tests (#68330)

* Simplify timezone setting in tests

* Fix typo

* Adjust caldav tests

* Adjust input_datetime tests

* Adjust time_date tests

* Adjust tod tests

* Adjust helper tests

* Adjust recorder tests

* Adjust risco tests

* Adjust aemet tests

* Adjust flux tests

* Adjust forecast_solar tests

* Revert unnecessary change in forecast_solar test

* Adjust climacell tests

* Adjust google tests

* Adjust sensor tests

* Adjust sonarr tests

* Adjust template tests

* Adjust zodiac tests

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Erik Montnemery 2022-03-20 10:25:15 +01:00 committed by GitHub
parent dbeec1f7da
commit cf4033b1bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 256 additions and 320 deletions

View file

@ -43,8 +43,11 @@ def mock_config_entry() -> MockConfigEntry:
@pytest.fixture
def mock_forecast_solar() -> Generator[None, MagicMock, None]:
"""Return a mocked Forecast.Solar client."""
def mock_forecast_solar(hass) -> Generator[None, MagicMock, None]:
"""Return a mocked Forecast.Solar client.
hass fixture included because it sets the time zone.
"""
with patch(
"homeassistant.components.forecast_solar.ForecastSolar", autospec=True
) as forecast_solar_mock: