public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/monkeytype] rawhide: Fix pytest 9 compatibility
@ 2026-08-10  2:27 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-10  2:27 UTC (permalink / raw)
  To: git-commits

            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
 

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

only message in thread, other threads:[~2026-08-10  2:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10  2:27 [rpms/monkeytype] rawhide: Fix pytest 9 compatibility 

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