From 5414e9d155c26963428dc3cc4b986b2238c08d1e Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 31 Dec 2019 14:30:09 +0100 Subject: [PATCH] Fix Withings leaking time zone change into other tests (#30320) * Fix Withings leaking time zone change in other tests * Fix spelling error in code doc --- tests/components/withings/test_common.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/components/withings/test_common.py b/tests/components/withings/test_common.py index 37fcb4ce7f5..6c8c0a4c310 100644 --- a/tests/components/withings/test_common.py +++ b/tests/components/withings/test_common.py @@ -15,6 +15,13 @@ from homeassistant.core import HomeAssistant from homeassistant.exceptions import PlatformNotReady from homeassistant.util import dt +DEFAULT_TIME_ZONE = dt.DEFAULT_TIME_ZONE + + +def teardown(): + """Ensure the time zone is reverted after tests finish.""" + dt.set_default_time_zone(DEFAULT_TIME_ZONE) + @pytest.fixture(name="withings_api") def withings_api_fixture() -> WithingsApi: