Skip to content

Commit 27e630c

Browse files
authored
Make systemmonitor tests timezone independent (home-assistant#152537)
1 parent ea88333 commit 27e630c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/components/systemmonitor/test_diagnostics.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from unittest.mock import Mock
44

5-
from freezegun.api import FrozenDateTimeFactory
5+
import pytest
66
from syrupy.assertion import SnapshotAssertion
77
from syrupy.filters import props
88

@@ -13,6 +13,7 @@
1313
from tests.typing import ClientSessionGenerator
1414

1515

16+
@pytest.mark.freeze_time("2024-02-24 15:00:00", tz_offset=0)
1617
async def test_diagnostics(
1718
hass: HomeAssistant,
1819
hass_client: ClientSessionGenerator,
@@ -27,14 +28,14 @@ async def test_diagnostics(
2728
) == snapshot(exclude=props("last_update", "entry_id", "created_at", "modified_at"))
2829

2930

31+
@pytest.mark.freeze_time("2024-02-24 15:00:00", tz_offset=0)
3032
async def test_diagnostics_missing_items(
3133
hass: HomeAssistant,
3234
hass_client: ClientSessionGenerator,
3335
mock_psutil: Mock,
3436
mock_os: Mock,
3537
mock_config_entry: MockConfigEntry,
3638
snapshot: SnapshotAssertion,
37-
freezer: FrozenDateTimeFactory,
3839
) -> None:
3940
"""Test diagnostics."""
4041
mock_psutil.net_if_addrs.return_value = None

0 commit comments

Comments
 (0)