From 902f997ee020539e0c0d76646e07cc15a76ae362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 18 Sep 2023 12:39:43 +0300 Subject: [PATCH] Fix google invalid token expiry test init for UTC offsets > 0 (#100533) ``` $ python3 -q >>> import datetime, time >>> time.tzname ('EET', 'EEST') >>> datetime.datetime.max.timestamp() Traceback (most recent call last): File "", line 1, in ValueError: year 10000 is out of range ``` --- tests/components/google/test_init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/components/google/test_init.py b/tests/components/google/test_init.py index 17f300f58cb51..233635510e07a 100644 --- a/tests/components/google/test_init.py +++ b/tests/components/google/test_init.py @@ -20,7 +20,7 @@ from homeassistant.const import ATTR_FRIENDLY_NAME, STATE_OFF from homeassistant.core import HomeAssistant, State from homeassistant.exceptions import HomeAssistantError -from homeassistant.util.dt import utcnow +from homeassistant.util.dt import UTC, utcnow from .conftest import ( CALENDAR_ID, @@ -645,7 +645,8 @@ async def test_add_event_location( @pytest.mark.parametrize( - "config_entry_token_expiry", [datetime.datetime.max.timestamp() + 1] + "config_entry_token_expiry", + [datetime.datetime.max.replace(tzinfo=UTC).timestamp() + 1], ) async def test_invalid_token_expiry_in_config_entry( hass: HomeAssistant,