public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ansible-core] f45: Fix test compatibility with pytest >= 9.1
@ 2026-08-14 18:59 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-14 18:59 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/ansible-core
            Branch : f45
            Commit : d295ff0e7be810bd21276264f8cc950a7877075c
            Author : Tomáš Hrnčiar <thrnciar@redhat.com>
            Date   : 2026-08-14T13:57:59-05:00
            Stats  : +31/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/ansible-core/c/d295ff0e7be810bd21276264f8cc950a7877075c?branch=f45

            Log:
            Fix test compatibility with pytest >= 9.1

Pytest 9.1 fixed parametrize to correctly unpack single-element tuple values
when using a string argnames with a trailing comma (e.g. "arg,"), treating it
like the tuple form ("arg",) (pytest-dev/pytest#719). This causes
test_missing_lchmod_is_link_in_sticky_dir to fail because the trailing comma
in @pytest.mark.parametrize('stdin,', ...) now makes pytest try to unpack {} as
a sequence, finding 0 elements for 1 name.

Remove the spurious trailing comma from 'stdin,'.

Assisted-by: Claude Opus 4.6

---
diff --git a/87165.patch b/87165.patch
new file mode 100644
index 0000000..7a1340c
--- /dev/null
+++ b/87165.patch
@@ -0,0 +1,28 @@
+From dbe7531eff8868aba9ba02dd88b92e561865306c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <tomas.hrnciar@me.com>
+Date: Wed, 24 Jun 2026 10:54:20 +0200
+Subject: [PATCH] Fix test compatibility with pytest >= 9.1
+
+Pytest 9.1 fixed parametrize to correctly unpack single-element tuple values when using a string argnames with a trailing comma (e.g. "arg,"), treating it like the tuple form ("arg",) (pytest-dev/pytest#719).
+This causes test_missing_lchmod_is_link_in_sticky_dir to fail because the trailing comma in @pytest.mark.parametrize('stdin,', ...) now makes pytest try to unpack {} as a sequence, finding 0 elements for 1 name.
+
+Remove the spurious trailing comma from 'stdin,'.
+
+Assisted-by: Claude Opus 4.6
+---
+ test/units/module_utils/basic/test_set_mode_if_different.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/units/module_utils/basic/test_set_mode_if_different.py b/test/units/module_utils/basic/test_set_mode_if_different.py
+index 45666608e48204..e15812aefe7ffc 100644
+--- a/test/units/module_utils/basic/test_set_mode_if_different.py
++++ b/test/units/module_utils/basic/test_set_mode_if_different.py
+@@ -151,7 +151,7 @@ def test_missing_lchmod_is_link(am, mock_stats, mocker, monkeypatch, check_mode)
+     mocker.stopall()
+ 
+ 
+-@pytest.mark.parametrize('stdin,',
++@pytest.mark.parametrize('stdin',
+                          ({},),
+                          indirect=['stdin'])
+ def test_missing_lchmod_is_link_in_sticky_dir(am, mock_stats, mocker):

diff --git a/ansible-core.spec b/ansible-core.spec
index 7c5278b..589446c 100644
--- a/ansible-core.spec
+++ b/ansible-core.spec
@@ -39,6 +39,9 @@ Patch:          allow-python3.15-build.patch
 # https://github.com/ansible/ansible/pull/86976
 Patch:          fix-compatibility-with-python-315.patch
 
+# Fix test compatibility with pytest 9.1
+Patch:          https://github.com/ansible/ansible/pull/87165.patch
+
 BuildArch:      noarch
 
 # Virtual provides for bundled libraries

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

only message in thread, other threads:[~2026-08-14 18:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-14 18:59 [rpms/ansible-core] f45: Fix test compatibility with pytest >= 9.1 

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