Skip to content

Commit

Permalink
dt.utcnow is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
oczoske committed Mar 4, 2025
1 parent 522d47c commit a57197c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions irdb/badges.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from numbers import Number
from string import Template
from datetime import datetime as dt
from datetime import UTC
from collections.abc import Mapping

import yaml
Expand Down Expand Up @@ -143,7 +144,7 @@ class BadgeReport(SystemDict):
that should be included in that report file:
>>> import pytest
>>>
>>>
>>> @pytest.fixture(name="badges", scope="module")
>>> def fixture_badges():
>>> with BadgeReport() as report:
Expand All @@ -161,7 +162,7 @@ class BadgeReport(SystemDict):
stored in the report, to be written in a separate log file at teardown:
>>> import logging
>>>
>>>
>>> def test_something_else(self, badges, caplog):
>>> logging.warning("Oh no!")
>>> badges.logs.extend(caplog.records)
Expand Down Expand Up @@ -252,7 +253,7 @@ def write_yaml(self) -> None:

def _make_preamble(self) -> str:
preamble = ("# IRDB Packages Report\n\n"
f"**Created on UTC {dt.utcnow():%Y-%m-%d %H:%M:%S}**\n\n"
f"**Created on UTC {dt.now(UTC):%Y-%m-%d %H:%M:%S}**\n\n"
"For details on errors and conflicts, see badge report "
"log file in this directory.\n\n")
return preamble
Expand Down

0 comments on commit a57197c

Please sign in to comment.