There is a patch upstream for this. It's not in a release however. I'm
attaching a debdiff to use it. The patch also touches the github CI
configuratio and I've chosen to keep the patch unchanged but it does add
some noise.

-- 
Adrien
diff -Nru freezegun-1.5.1/debian/changelog freezegun-1.5.1/debian/changelog
--- freezegun-1.5.1/debian/changelog    2024-07-13 22:09:45.000000000 +0200
+++ freezegun-1.5.1/debian/changelog    2025-01-14 12:07:51.000000000 +0100
@@ -1,3 +1,10 @@
+freezegun (1.5.1-2) unstable; urgency=medium
+
+  * d/p/admin-support-python-3.13.patch: fix tests for python3.13
+    (Closes: #1090225)
+
+ -- Adrien Nader <adrien.na...@canonical.com>  Tue, 14 Jan 2025 12:07:51 +0100
+
 freezegun (1.5.1-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru freezegun-1.5.1/debian/patches/admin-support-python-3.13.patch 
freezegun-1.5.1/debian/patches/admin-support-python-3.13.patch
--- freezegun-1.5.1/debian/patches/admin-support-python-3.13.patch      
1970-01-01 01:00:00.000000000 +0100
+++ freezegun-1.5.1/debian/patches/admin-support-python-3.13.patch      
2025-01-14 10:37:37.000000000 +0100
@@ -0,0 +1,87 @@
+From 1777174bb97c0b514033a09b820078b0d117f4a8 Mon Sep 17 00:00:00 2001
+From: Bert Blommers <i...@bertblommers.nl>
+Date: Fri, 28 Jun 2024 19:21:04 +0000
+Subject: [PATCH] Admin: Support Python 3.13
+
+
+Forwarded: not-needed
+Applied-Upstream: 
https://github.com/spulec/freezegun/commit/1777174bb97c0b514033a09b820078b0d117f4a8
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1090225
+Bug: https://github.com/spulec/freezegun/issues/547
+
+---
+ .github/workflows/ci.yaml | 9 ++++++---
+ tests/test_datetimes.py   | 6 +++---
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
+index 67c263e..59200ca 100644
+--- a/.github/workflows/ci.yaml
++++ b/.github/workflows/ci.yaml
+@@ -11,18 +11,20 @@ jobs:
+     strategy:
+       matrix:
+         python-version:
+-          - '3.7'
+           - '3.8'
+           - '3.9'
+           - '3.10'
+           - '3.11'
+           - '3.12'
++          - '3.13.0-beta.2'
+ 
+     steps:
+       - uses: actions/checkout@master
+ 
+       - name: Set up Python
+         uses: actions/setup-python@v4
++        with:
++          python-version: ${{ matrix.python-version }}
+ 
+       - name: Install dependencies
+         run: |
+@@ -44,16 +46,17 @@ jobs:
+           - '3.10'
+           - '3.11'
+           - '3.12'
++          - '3.13.0-beta.2'
+         implementation:
+           - ''      # CPython
+           - 'pypy'  # PyPy
+         exclude:    # unreleased;
+-          - implementation: 'pypy'
+-            python-version: '3.10'
+           - implementation: 'pypy'
+             python-version: '3.11'
+           - implementation: 'pypy'
+             python-version: '3.12'
++          - implementation: 'pypy'
++            python-version: '3.13.0-beta.2'
+ 
+     steps:
+       - uses: actions/checkout@master
+diff --git a/tests/test_datetimes.py b/tests/test_datetimes.py
+index a6f1989..b75ad3b 100644
+--- a/tests/test_datetimes.py
++++ b/tests/test_datetimes.py
+@@ -534,17 +534,17 @@ def test_method_decorator_works_on_unittest(self) -> 
None:
+     @freeze_time('2013-04-09', as_kwarg='frozen_time')
+     def test_method_decorator_works_on_unittest_kwarg_frozen_time(self, 
frozen_time: Any) -> None:
+         self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
+-        self.assertEqual(datetime.date(2013, 4, 9), 
frozen_time.time_to_freeze.today())
++        assert frozen_time.time_to_freeze.today().strftime('%Y-%m-%d') == 
"2013-04-09"
+ 
+     @freeze_time('2013-04-09', as_kwarg='hello')
+     def test_method_decorator_works_on_unittest_kwarg_hello(self, **kwargs: 
Any) -> None:
+         self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
+-        self.assertEqual(datetime.date(2013, 4, 9), 
kwargs.get('hello').time_to_freeze.today())  # type: ignore
++        assert 
kwargs.get("hello").time_to_freeze.today().strftime('%Y-%m-%d') == "2013-04-09" 
 # type: ignore
+ 
+     @freeze_time(lambda: datetime.date(year=2013, month=4, day=9), 
as_kwarg='frozen_time')
+     def 
test_method_decorator_works_on_unittest_kwarg_frozen_time_with_func(self, 
frozen_time: Any) -> None:
+         self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
+-        self.assertEqual(datetime.date(2013, 4, 9), 
frozen_time.time_to_freeze.today())
++        assert frozen_time.time_to_freeze.today().strftime('%Y-%m-%d') == 
"2013-04-09"
+ 
+ 
+ @freeze_time('2013-04-09')
diff -Nru freezegun-1.5.1/debian/patches/series 
freezegun-1.5.1/debian/patches/series
--- freezegun-1.5.1/debian/patches/series       2024-07-13 22:09:45.000000000 
+0200
+++ freezegun-1.5.1/debian/patches/series       2025-01-14 12:02:05.000000000 
+0100
@@ -1 +1 @@
-
+admin-support-python-3.13.patch

Reply via email to