Skip to content

DeprecationWarning: datetime.datetime.utcfromtimestamp() #214

@cclauss

Description

@cclauss

https://docs.python.org/3/library/datetime.html#datetime.datetime.utcfromtimestamp

Our CircleCI runs of pytest produce 198 deprecation warnings:

=============================== warnings summary ===============================
test_replays/test_replays.py: 97 warnings
/home/circleci/project/sc2reader/resources.py:414: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
self.end_time = datetime.utcfromtimestamp(self.unix_timestamp)

test_replays/test_replays.py: 97 warnings
/home/circleci/project/sc2reader/resources.py:432: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
self.start_time = datetime.utcfromtimestamp(

test_s2gs/test_all.py::TestSummaries::test_a_LotV_s2gs
test_s2gs/test_all.py::TestSummaries::test_a_WoL_s2gs
/home/circleci/project/sc2reader/resources.py:1094: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
self.end_time = datetime.utcfromtimestamp(self.parts[0][8])

test_s2gs/test_all.py::TestSummaries::test_a_LotV_s2gs
test_s2gs/test_all.py::TestSummaries::test_a_WoL_s2gs
/home/circleci/project/sc2reader/resources.py:1102: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
self.start_time = datetime.utcfromtimestamp(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================= 69 passed, 3 xfailed, 198 warnings in 20.95s =================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions