public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/monkeytype] rawhide: Fix pytest 9 compatibility
Date: Mon, 10 Aug 2026 02:27:08 GMT [thread overview]
Message-ID: <178632882837.1.11922527094784439663.rpms-monkeytype-518b1b16045a@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/monkeytype
Branch : rawhide
Commit : 518b1b16045a525185baeeafd8186ed2b52ec1f4
Author : Tomáš Hrnčiar <thrnciar@redhat.com>
Date : 2026-08-10T01:59:14+00:00
Stats : +30/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/monkeytype/c/518b1b16045a525185baeeafd8186ed2b52ec1f4?branch=rawhide
Log:
Fix pytest 9 compatibility
Backport upstream PR #385 to fix test_excludes_site_packages.
pytest.skip is now a _Skip callable object in pytest 9, no longer
a plain function with __code__. Use pytest.main instead.
Assisted-by: Cursor
---
diff --git a/385.patch b/385.patch
new file mode 100644
index 0000000..8ba16ff
--- /dev/null
+++ b/385.patch
@@ -0,0 +1,28 @@
+From b8a70a8a1af1143621d483d77cef47aa4d9ee08e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
+Date: Tue, 7 Apr 2026 14:43:59 +0200
+Subject: [PATCH] Fix test_excludes_site_packages for pytest 9
+
+In pytest 9, `pytest.skip` changed from a plain function to a `_Skip`
+callable object, so it no longer has a `__code__` attribute. Use
+`pytest.main` instead, which is still a regular function and serves the
+same purpose of providing a code object from site-packages.
+
+Assisted-by: Cursor
+---
+ tests/test_config.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_config.py b/tests/test_config.py
+index 89446779..337602ca 100644
+--- a/tests/test_config.py
++++ b/tests/test_config.py
+@@ -16,7 +16,7 @@ def test_excludes_stdlib(self):
+ assert not config.default_code_filter(sysconfig.get_path.__code__)
+
+ def test_excludes_site_packages(self):
+- assert not config.default_code_filter(pytest.skip.__code__)
++ assert not config.default_code_filter(pytest.main.__code__)
+
+ def test_includes_otherwise(self):
+ assert config.default_code_filter(config.default_code_filter.__wrapped__.__code__)
diff --git a/monkeytype.spec b/monkeytype.spec
index 8b92790..414bbf9 100644
--- a/monkeytype.spec
+++ b/monkeytype.spec
@@ -16,6 +16,8 @@ URL: https://github.com/instagram/%{srcname}
# PyPI source has no tests
# Source: %%{pypi_source %%{srcname}}
Source: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
+# pytest 9 compatibility
+Patch: https://github.com/Instagram/MonkeyType/pull/385.patch
BuildArch: noarch
reply other threads:[~2026-08-10 2:27 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=178632882837.1.11922527094784439663.rpms-monkeytype-518b1b16045a@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