Skip to content

Commit c53cc7f

Browse files
committed
fix: tests with timezone
1 parent 69d2083 commit c53cc7f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/cli/scheduler/test_task_delays.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ def test_should_run_success() -> None:
2222

2323

2424
def test_should_run_cron_str_offset() -> None:
25-
hour = datetime.datetime.now().hour
25+
timezone = ZoneInfo("Europe/Paris")
26+
hour = datetime.datetime.now(tz=timezone).hour
2627
delay = get_task_delay(
2728
ScheduledTask(
2829
task_name="",
2930
labels={},
3031
args=[],
3132
kwargs={},
3233
cron=f"* {hour} * * *",
33-
cron_offset=str(ZoneInfo("Europe/Paris")),
34+
cron_offset=str(timezone),
3435
),
3536
)
3637
assert delay is not None and delay >= 0

0 commit comments

Comments
 (0)