public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/reuse] epel10: Fix infinite hangup in unit tests
Date: Wed, 19 Aug 2026 12:50:30 GMT	[thread overview]
Message-ID: <178714383047.1.40077712242838578.rpms-reuse-d0b98f4f2fcd@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-08-19 12:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178714383047.1.40077712242838578.rpms-reuse-d0b98f4f2fcd@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox