Skip to content

Commit 40c19eb

Browse files
committed
removed locale setting
1 parent 69b19cf commit 40c19eb

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

tests/test_unit_trigger.py

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Unit tests for time trigger functions."""
22

33
from datetime import datetime as dt
4-
import locale
54

65
from custom_components.pyscript.function import Function
76
from custom_components.pyscript.trigger import TrigTime
@@ -70,11 +69,6 @@ async def test_parse_date_time(hass, caplog):
7069
hass.config.elevation = 0
7170
hass.config.time_zone = "America/Los_Angeles"
7271

73-
#
74-
# Set English since the week names use locale
75-
#
76-
locale.setlocale(locale.LC_ALL, "en_US")
77-
7872
Function.init(hass)
7973
TrigTime.init(hass)
8074

@@ -111,11 +105,6 @@ async def test_parse_date_time_day_names(hass, caplog):
111105
hass.config.elevation = 0
112106
hass.config.time_zone = "America/Los_Angeles"
113107

114-
#
115-
# Set English since the week names use locale
116-
#
117-
locale.setlocale(locale.LC_ALL, "en_US")
118-
119108
Function.init(hass)
120109
TrigTime.init(hass)
121110

@@ -178,10 +167,7 @@ async def test_parse_date_time_day_names(hass, caplog):
178167
)
179168
def test_timer_active_check(hass, spec, now, expected):
180169
"""Run time active check tests."""
181-
#
182-
# Set English since the week names use locale
183-
#
184-
locale.setlocale(locale.LC_ALL, "en_US")
170+
185171
Function.init(hass)
186172
TrigTime.init(hass)
187173
out = TrigTime.timer_active_check(spec, now)
@@ -359,11 +345,6 @@ def test_timer_trigger_next(hass):
359345
hass.config.longitude = -122
360346
hass.config.elevation = 0
361347
hass.config.time_zone = "America/Los_Angeles"
362-
#
363-
364-
# Set English since the week names use locale
365-
#
366-
locale.setlocale(locale.LC_ALL, "en_US")
367348

368349
Function.init(hass)
369350
TrigTime.init(hass)
@@ -474,12 +455,10 @@ def test_timer_trigger_next(hass):
474455

475456
def test_timer_trigger_next_month_rollover(hass):
476457
"""Run month rollover tests."""
477-
#
478-
# Set English since the week names use locale
479-
#
480-
locale.setlocale(locale.LC_ALL, "en_US")
458+
481459
Function.init(hass)
482460
TrigTime.init(hass)
461+
483462
for test_data in timerTriggerNextTestsMonthRollover:
484463
now = dt(2020, 6, 30, 13, 0, 0, 100000)
485464
spec, expect_seq = test_data

0 commit comments

Comments
 (0)