Mercurial > personal > weather-server
comparison weather_server/logfile_test.py @ 39:b77c8e7d2742
Use zoneinfo rather than pytz.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Tue, 01 Apr 2025 15:54:21 -0400 |
| parents | 9bc3687e1e5e |
| children |
comparison
equal
deleted
inserted
replaced
| 38:d5a18ecebf47 | 39:b77c8e7d2742 |
|---|---|
| 4 import pathlib | 4 import pathlib |
| 5 import tempfile | 5 import tempfile |
| 6 import unittest | 6 import unittest |
| 7 | 7 |
| 8 import bson | 8 import bson |
| 9 import pytz | |
| 10 | 9 |
| 11 from . import common | 10 from . import common |
| 12 from . import logfile | 11 from . import logfile |
| 13 | 12 |
| 14 | 13 |
| 15 def ts(n): | 14 def ts(n): |
| 16 return datetime.datetime.utcfromtimestamp(n).replace(tzinfo=pytz.UTC) | 15 return datetime.datetime.fromtimestamp(n, datetime.UTC) |
| 17 | 16 |
| 18 | 17 |
| 19 class LoggerTest(unittest.TestCase): | 18 class LoggerTest(unittest.TestCase): |
| 20 | 19 |
| 21 maxDiff = None | 20 maxDiff = None |
