mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
housekeep: replace deprecated datetime functions
tests show warnings for deprecated utc functions with python 3.12 Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
ffddf63975
commit
afb7af3e27
9 changed files with 21 additions and 21 deletions
|
@ -1,4 +1,4 @@
|
|||
from datetime import datetime
|
||||
from datetime import UTC, datetime
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
import pytest
|
||||
|
@ -8,7 +8,7 @@ from aurweb import filters, time
|
|||
|
||||
def test_timestamp_to_datetime():
|
||||
ts = time.utcnow()
|
||||
dt = datetime.utcfromtimestamp(int(ts))
|
||||
dt = datetime.fromtimestamp(ts, UTC)
|
||||
assert filters.timestamp_to_datetime(ts) == dt
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue