Skip to content

Commit c2e45b3

Browse files
authored
Remove unncessary use of tzdata in tests (#1261)
This PR fixes the issue reported in #1260 where tests failed on Windows because the "Europe/Berlin" timezone could not be loaded. On Linux, zoneinfo can read timezone data from the system, but on Windows it requires the PyPI tzdata package.
2 parents 9316230 + ebfe97a commit c2e45b3

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

tests/microgrid/test_microgrid_api.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""Tests of MicrogridApi."""
55

66
import asyncio
7-
import zoneinfo
87
from asyncio.tasks import ALL_COMPLETED
98
from unittest import mock
109
from unittest.mock import AsyncMock, MagicMock
@@ -102,7 +101,6 @@ def metadata(self) -> Metadata:
102101
location=Location(
103102
latitude=52.520008,
104103
longitude=13.404954,
105-
timezone=zoneinfo.ZoneInfo("Europe/Berlin"),
106104
),
107105
)
108106

@@ -170,8 +168,6 @@ async def test_connection_manager(
170168

171169
assert api.microgrid_id == metadata.microgrid_id
172170
assert api.location == metadata.location
173-
assert api.location and api.location.timezone
174-
assert api.location.timezone.key == "Europe/Berlin"
175171

176172
# It should not be possible to initialize method once again
177173
with pytest.raises(AssertionError):
@@ -215,5 +211,3 @@ async def test_connection_manager_another_method(
215211

216212
assert api.microgrid_id == metadata.microgrid_id
217213
assert api.location == metadata.location
218-
assert api.location and api.location.timezone
219-
assert api.location.timezone.key == "Europe/Berlin"

0 commit comments

Comments
 (0)