diff --git a/tests/components/bmw_connected_drive/test_diagnostics.py b/tests/components/bmw_connected_drive/test_diagnostics.py index 5b22fdcf71d..2f58bc0e4a0 100644 --- a/tests/components/bmw_connected_drive/test_diagnostics.py +++ b/tests/components/bmw_connected_drive/test_diagnostics.py @@ -1,8 +1,6 @@ """Test BMW diagnostics.""" import datetime -import os -import time import pytest from syrupy.assertion import SnapshotAssertion @@ -20,7 +18,7 @@ from tests.components.diagnostics import ( from tests.typing import ClientSessionGenerator -@pytest.mark.freeze_time(datetime.datetime(2022, 7, 10, 11)) +@pytest.mark.freeze_time(datetime.datetime(2022, 7, 10, 11, tzinfo=datetime.UTC)) async def test_config_entry_diagnostics( hass: HomeAssistant, hass_client: ClientSessionGenerator, @@ -29,10 +27,6 @@ async def test_config_entry_diagnostics( ) -> None: """Test config entry diagnostics.""" - # Make sure that local timezone for test is UTC - os.environ["TZ"] = "UTC" - time.tzset() - mock_config_entry = await setup_mocked_integration(hass) diagnostics = await get_diagnostics_for_config_entry( @@ -42,7 +36,7 @@ async def test_config_entry_diagnostics( assert diagnostics == snapshot -@pytest.mark.freeze_time(datetime.datetime(2022, 7, 10, 11)) +@pytest.mark.freeze_time(datetime.datetime(2022, 7, 10, 11, tzinfo=datetime.UTC)) async def test_device_diagnostics( hass: HomeAssistant, hass_client: ClientSessionGenerator, @@ -52,10 +46,6 @@ async def test_device_diagnostics( ) -> None: """Test device diagnostics.""" - # Make sure that local timezone for test is UTC - os.environ["TZ"] = "UTC" - time.tzset() - mock_config_entry = await setup_mocked_integration(hass) reg_device = device_registry.async_get_device( @@ -70,7 +60,7 @@ async def test_device_diagnostics( assert diagnostics == snapshot -@pytest.mark.freeze_time(datetime.datetime(2022, 7, 10, 11)) +@pytest.mark.freeze_time(datetime.datetime(2022, 7, 10, 11, tzinfo=datetime.UTC)) async def test_device_diagnostics_vehicle_not_found( hass: HomeAssistant, hass_client: ClientSessionGenerator, @@ -80,10 +70,6 @@ async def test_device_diagnostics_vehicle_not_found( ) -> None: """Test device diagnostics when the vehicle cannot be found.""" - # Make sure that local timezone for test is UTC - os.environ["TZ"] = "UTC" - time.tzset() - mock_config_entry = await setup_mocked_integration(hass) reg_device = device_registry.async_get_device(