public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/reuse] epel10: Fix infinite hangup in unit tests
@ 2026-08-19 12:50 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-19 12:50 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/reuse
            Branch : epel10
            Commit : d0b98f4f2fcdfbab19ac96b7683caace74c7c7f9
            Author : Jan Staněk <jstanek@redhat.com>
            Date   : 2025-03-27T14:25:10+01:00
            Stats  : +49/-2 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/reuse/c/d0b98f4f2fcdfbab19ac96b7683caace74c7c7f9?branch=epel10

            Log:
            Fix infinite hangup in unit tests

With freezegun < 1.5.1, test(s) that would use the freeze_time
decorator would freeze the test suite indefinitely.

---
diff --git a/0001-Use-importlib-mode-for-pytest.patch b/0001-Use-importlib-mode-for-pytest.patch
index 7d2a236..464a503 100644
--- a/0001-Use-importlib-mode-for-pytest.patch
+++ b/0001-Use-importlib-mode-for-pytest.patch
@@ -1,4 +1,4 @@
-From 0121e97c889e2436d2d8bf202ebef8f6f5a34f28 Mon Sep 17 00:00:00 2001
+From 64e46322c876c0114ebe537dd8fa87915c63fa74 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= <jstanek@redhat.com>
 Date: Mon, 8 Jul 2024 14:04:01 +0200
 Subject: [PATCH] Use importlib mode for pytest
@@ -149,5 +149,5 @@ index 3afc9d9..4dbef89 100644
  
  
 -- 
-2.47.0
+2.49.0
 

diff --git a/0002-Skip-tests-with-old-freezegun.patch b/0002-Skip-tests-with-old-freezegun.patch
new file mode 100644
index 0000000..a90676e
--- /dev/null
+++ b/0002-Skip-tests-with-old-freezegun.patch
@@ -0,0 +1,46 @@
+From a644c750b6ab49effae1e436f2750dac46701553 Mon Sep 17 00:00:00 2001
+From: rpm-build <rpm-build>
+Date: Thu, 27 Mar 2025 14:19:28 +0100
+Subject: [PATCH] Skip tests with old freezegun
+
+The freezegun < 1.5.1 hangs indefinitely in mock.
+
+Signed-off-by: rpm-build <rpm-build>
+---
+ tests/test_cli_spdx.py | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/tests/test_cli_spdx.py b/tests/test_cli_spdx.py
+index b9bb466..fc6a737 100644
+--- a/tests/test_cli_spdx.py
++++ b/tests/test_cli_spdx.py
+@@ -10,6 +10,9 @@
+ 
+ """Tests for spdx."""
+ 
++from importlib import metadata
++
++import pytest
+ from click.testing import CliRunner
+ from freezegun import freeze_time
+ 
+@@ -17,10 +20,16 @@ from reuse.cli.main import main
+ 
+ # pylint: disable=unused-argument
+ 
++FREEZEGUN_VERSION = tuple(map(int, metadata.version("freezegun").split(".")))
++
+ 
+ class TestSpdx:
+     """Tests for spdx."""
+ 
++    @pytest.mark.skipif(
++        FREEZEGUN_VERSION < (1,5,1),
++        reason="Blocks forever on old version(s) of freezegun.",
++    )
+     @freeze_time("2024-04-08T17:34:00Z")
+     def test_simple(self, fake_repository):
+         """Compile to an SPDX document."""
+-- 
+2.49.0
+

diff --git a/reuse.spec b/reuse.spec
index 5176085..07161a9 100644
--- a/reuse.spec
+++ b/reuse.spec
@@ -9,6 +9,7 @@ Url:            https://github.com/fsfe/reuse-tool
 Source0:        %pypi_source
 
 Patch:          0001-Use-importlib-mode-for-pytest.patch
+Patch:          0002-Skip-tests-with-old-freezegun.patch
 
 # Build
 BuildRequires:  python3-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-19 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-19 12:50 [rpms/reuse] epel10: Fix infinite hangup in unit tests 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox