Hochfrequenz / ahbicht

Python Package that parses Condition Expressions from Anwendungshandbüchers ("AHB")
MIT License
4 stars 0 forks source link

Fix DeprecationWarning for `datetime.datetime.utcnow()` #480

Open hf-krechan opened 1 week ago

hf-krechan commented 1 week ago
=========================================================================================== warnings summary ============================================================================================
unittests/test_condition_parser.py::TestConditionParser::test_parsing_is_thread_safe
  /Users/kevin/workspaces/hochfrequenz/ahbicht/unittests/test_condition_parser.py:555: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    start = datetime.datetime.utcnow()

unittests/test_condition_parser.py::TestConditionParser::test_parsing_is_thread_safe
  /Users/kevin/workspaces/hochfrequenz/ahbicht/unittests/test_condition_parser.py:557: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    stop = datetime.datetime.utcnow()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
hf-kklein commented 1 week ago

reproducable in python >=3.12