From 9422c4de65aafc693440af1f4b8f41fbd7d17744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ab=C3=ADlio=20Costa?= Date: Mon, 17 Feb 2025 15:01:03 +0000 Subject: [PATCH] Fix snapshots timezone in Cloud tests (#138393) * Fix snapshots timezone in Cloud tests * Add explanation comment --- tests/components/cloud/test_http_api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/components/cloud/test_http_api.py b/tests/components/cloud/test_http_api.py index c8852b911e9..ef4b93a8aab 100644 --- a/tests/components/cloud/test_http_api.py +++ b/tests/components/cloud/test_http_api.py @@ -1943,7 +1943,10 @@ async def test_download_support_package( ) now = dt_util.utcnow() - freezer.move_to(datetime.datetime.fromisoformat("2025-02-10T12:00:00.0+00:00")) + # The logging is done with local time according to the system timezone. Set the + # fake time to 12:00 local time + tz = now.astimezone().tzinfo + freezer.move_to(datetime.datetime(2025, 2, 10, 12, 0, 0, tzinfo=tz)) logging.getLogger("hass_nabucasa.iot").info( "This message will be dropped since this test patches MAX_RECORDS" )