mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Avoid use of datetime.utc* methods deprecated in Python 3.12 (#93684)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,7 @@ from homeassistant.components.application_credentials import (
|
||||
from homeassistant.components.google import DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
@@ -138,9 +139,7 @@ def token_scopes() -> list[str]:
|
||||
def token_expiry() -> datetime.datetime:
|
||||
"""Expiration time for credentials used in the test."""
|
||||
# OAuth library returns an offset-naive timestamp
|
||||
return datetime.datetime.fromtimestamp(
|
||||
datetime.datetime.utcnow().timestamp()
|
||||
) + datetime.timedelta(hours=1)
|
||||
return dt_util.utcnow().replace(tzinfo=None) + datetime.timedelta(hours=1)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user