mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-08-16 07:29:47 +00:00
fix(tests): update timezone handling in test_dashboard_stats.py
- Changed the timezone handling in the test from UTC to timezone.utc for improved clarity and consistency in datetime operations.
This commit is contained in:
@@ -13,7 +13,7 @@ import sqlite3
|
||||
import time
|
||||
from configparser import ConfigParser
|
||||
from contextlib import closing
|
||||
from datetime import UTC, datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
@@ -463,7 +463,7 @@ class TestRollupCorrectness:
|
||||
time.tzset()
|
||||
try:
|
||||
# 03:00 UTC is 20:00 the previous day in Los Angeles.
|
||||
utc_moment = datetime(2026, 7, 29, 3, 0, tzinfo=UTC)
|
||||
utc_moment = datetime(2026, 7, 29, 3, 0, tzinfo=timezone.utc)
|
||||
local_date = utc_moment.astimezone().strftime("%Y-%m-%d")
|
||||
assert local_date == "2026-07-28", "fixture assumes a UTC-7/8 offset"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user