Skip to content

Commit

Permalink
Fix google invalid token expiry test init for UTC offsets > 0 (#100533)
Browse files Browse the repository at this point in the history
```
$ python3 -q
>>> import datetime, time
>>> time.tzname
('EET', 'EEST')
>>> datetime.datetime.max.timestamp()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: year 10000 is out of range
```
  • Loading branch information
scop authored Sep 18, 2023
1 parent f41e3a2 commit 902f997
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/components/google/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 902f997

Please sign in to comment.