public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/pyxdg] f45: Fix test_inheritance test failure with shared-mime-info 2.5.0
@ 2026-08-13  7:21 Tomas Popela
  0 siblings, 0 replies; only message in thread
From: Tomas Popela @ 2026-08-13  7:21 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/pyxdg
            Branch : f45
            Commit : faa52c5f81f6ed7cbd9116979a1b6b6716c314ce
            Author : Tomas Popela <tpopela@redhat.com>
            Date   : 2026-08-13T09:21:39+02:00
            Stats  : +23/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/pyxdg/c/faa52c5f81f6ed7cbd9116979a1b6b6716c314ce?branch=f45

            Log:
            Fix test_inheritance test failure with shared-mime-info 2.5.0

Assisted-by: Claude Code

---
diff --git a/pyxdg-fix-test-mime-inheritance.patch b/pyxdg-fix-test-mime-inheritance.patch
new file mode 100644
index 0000000..893ee97
--- /dev/null
+++ b/pyxdg-fix-test-mime-inheritance.patch
@@ -0,0 +1,15 @@
+--- a/test/test_mime.py	2026-08-13 08:48:47.937849559 +0200
++++ b/test/test_mime.py	2026-08-13 08:53:01.072858460 +0200
+@@ -152,9 +152,10 @@
+     def test_inheritance(self):
+         text_python = Mime.lookup('text/x-python')
+         self.check_mimetype(text_python, 'text', 'x-python')
+-        text_plain = Mime.lookup('text/plain')
+         app_executable = Mime.lookup('application/x-executable')
+-        self.assertEqual(text_python.inherits_from(), set([text_plain, app_executable]))
++        parents = text_python.inherits_from()
++        self.assertTrue(len(parents) > 0)
++        self.assertIn(app_executable, parents)
+     
+     def test_is_text(self):
+         assert Mime._is_text(b'abcdef \n')

diff --git a/pyxdg.spec b/pyxdg.spec
index 4d2c09f..8a89f26 100644
--- a/pyxdg.spec
+++ b/pyxdg.spec
@@ -1,6 +1,6 @@
 Name:           pyxdg
 Version:        0.28
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Python library to access freedesktop.org standards
 License:        LGPL-2.0-only
 URL:            http://freedesktop.org/Software/pyxdg
@@ -11,6 +11,9 @@ Patch0:         pyxdg-replace-imp-with-importlib.patch
 Patch1:         pyxdg-handle-python-3.14-ast.Str-changes.patch
 # https://cgit.freedesktop.org/xdg/pyxdg/commit/?id=63033ac306aa26d32e1439417e59ae8f8a4c9820
 Patch2:         pyxdg-handle-python-3.15-deprecations.patch
+# Fix test_inheritance failure with shared-mime-info >= 2.5
+# https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/5b8e53fd59dd5a5b9445b455402dd94cd64dc962
+Patch3:         pyxdg-fix-test-mime-inheritance.patch
 
 BuildArch:      noarch
 # These are needed for the tests.
@@ -34,6 +37,7 @@ package contains a Python 3 version of PyXDG.
 %patch -P0 -p1 -b .replace-imp-with-importlib
 %patch -P1 -p1 -b .handle-python-3.14-ast.Str-changes
 %patch -P2 -p1 -b .handle-python-3.15-deprecations
+%patch -P3 -p1 -b .fix-test-mime-inheritance
 
 # fix symlink example
 rm -rf test/example/png_symlink
@@ -60,6 +64,9 @@ popd
 %doc AUTHORS ChangeLog README TODO
 
 %changelog
+* Thu Aug 13 2026 Tomas Popela <tpopela@redhat.com> - 0.28-4
+- Fix test_inheritance test failure with shared-mime-info 2.5.0
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.28-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

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

only message in thread, other threads:[~2026-08-13  7:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13  7:21 [rpms/pyxdg] f45: Fix test_inheritance test failure with shared-mime-info 2.5.0 Tomas Popela

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