From 5fe3c4010b82a2e5128308f360643bc4ed161991 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 13:15:16 +0000 Subject: [PATCH 1/3] Initial plan From 8520d8c4c455f691c21d3d4f258e989bb09e43ed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 13:54:26 +0000 Subject: [PATCH 2/3] Fix DeprecationWarning: replace deprecated datetime.utcnow() in conftest.py Agent-Logs-Url: https://github.com/wolph/python-progressbar/sessions/2475a328-cf62-4d16-91e5-13ac2078e52d Co-authored-by: wolph <270571+wolph@users.noreply.github.com> --- tests/conftest.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 787e643..dc6265a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,7 @@ import logging import time import timeit -from datetime import datetime +from datetime import datetime, timezone import freezegun import pytest @@ -37,10 +37,11 @@ def small_interval(monkeypatch) -> None: @pytest.fixture(autouse=True) def sleep_faster(monkeypatch): - # The timezone offset in seconds, add 10 seconds to make sure we don't - # accidentally get the wrong hour - offset_seconds = (datetime.now() - datetime.utcnow()).seconds + 10 - offset_hours = int(offset_seconds / 3600) + # Compute the local UTC offset so freezegun uses the same timezone as + # the local system. Using datetime.now(timezone.utc).astimezone() avoids + # the deprecated datetime.utcnow() which was removed in Python 3.12+. + local_offset = datetime.now(timezone.utc).astimezone().utcoffset() + offset_hours = local_offset.total_seconds() / 3600 freeze_time = freezegun.freeze_time(tz_offset=offset_hours) with freeze_time as fake_time: From 0c153cf573aa3b2c8bbb0108d3ed3e4af1750690 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Apr 2026 01:53:45 +0000 Subject: [PATCH 3/3] Fix comment wording: utcnow() is deprecated not removed in Python 3.12 Agent-Logs-Url: https://github.com/wolph/python-progressbar/sessions/fdfa1d3f-c76d-4b45-a83f-e4d4446e7db3 Co-authored-by: wolph <270571+wolph@users.noreply.github.com> --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index dc6265a..59cbe7d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -39,7 +39,7 @@ def small_interval(monkeypatch) -> None: def sleep_faster(monkeypatch): # Compute the local UTC offset so freezegun uses the same timezone as # the local system. Using datetime.now(timezone.utc).astimezone() avoids - # the deprecated datetime.utcnow() which was removed in Python 3.12+. + # the deprecated datetime.utcnow() (deprecated since Python 3.12). local_offset = datetime.now(timezone.utc).astimezone().utcoffset() offset_hours = local_offset.total_seconds() / 3600