public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/ansible-core] rawhide: Fix test compatibility with pytest >= 9.1
Date: Fri, 14 Aug 2026 18:58:54 GMT	[thread overview]
Message-ID: <178673393493.1.12090229600464232872.rpms-ansible-core-d295ff0e7be8@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/ansible-core
            Branch : rawhide
            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=rawhide

            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

                 reply	other threads:[~2026-08-14 18:58 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=178673393493.1.12090229600464232872.rpms-ansible-core-d295ff0e7be8@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