public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/pytest] rawhide: Fix 1 remaining test failure with Python 3.15
@ 2026-07-28 10:36
0 siblings, 0 replies; only message in thread
From: @ 2026-07-28 10:36 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/pytest
Branch : rawhide
Commit : c0b740987182f92698a1bd5fd55634162c81d745
Author : Miro Hrončok <miro@hroncok.cz>
Date : 2026-07-27T18:39:48+02:00
Stats : +37/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/pytest/c/c0b740987182f92698a1bd5fd55634162c81d745?branch=rawhide
Log:
Fix 1 remaining test failure with Python 3.15
---
diff --git a/7202c3af8.patch b/7202c3af8.patch
new file mode 100644
index 0000000..4430ebc
--- /dev/null
+++ b/7202c3af8.patch
@@ -0,0 +1,34 @@
+From 7202c3af81c208521524389fcf374fd73211b51b Mon Sep 17 00:00:00 2001
+From: Ran Benita <ran@unusedvar.com>
+Date: Wed, 27 May 2026 11:03:05 +0300
+Subject: [PATCH] testing: fix `test_dont_write_bytecode` for Python 3.15
+
+Python 3.15b1 no longer sets `module.__cached__`. But
+`module.__spec__.cached` is still set, is recommended over
+`module.__cached__` by Python documentation, and it works for all
+previous versions as well, so switch to that.
+
+Ref:
+https://docs.python.org/3.15/reference/datamodel.html#module.__file__
+---
+ testing/test_assertrewrite.py | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py
+index 2668001af65..e11863547ba 100644
+--- a/testing/test_assertrewrite.py
++++ b/testing/test_assertrewrite.py
+@@ -1082,9 +1082,10 @@ def test_dont_write_bytecode(self, pytester: Pytester, monkeypatch) -> None:
+ """
+ import os
+ def test_no_bytecode():
+- assert "__pycache__" in __cached__
+- assert not os.path.exists(__cached__)
+- assert not os.path.exists(os.path.dirname(__cached__))"""
++ assert "__pycache__" in __spec__.cached
++ assert not os.path.exists(__spec__.cached)
++ assert not os.path.exists(os.path.dirname(__spec__.cached))
++ """
+ )
+ monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
+ assert pytester.runpytest_subprocess().ret == 0
diff --git a/pytest.spec b/pytest.spec
index 517d1da..a7d86ae 100644
--- a/pytest.spec
+++ b/pytest.spec
@@ -7,6 +7,9 @@ License: MIT
URL: https://pytest.org
Source: %{pypi_source pytest %{version}}
+# Fix test_dont_write_bytecode for Python 3.15 (__cached__ no longer set)
+Patch: https://github.com/pytest-dev/pytest/commit/7202c3af8.patch
+
# Remove -s from Python shebang,
# ensure that packages installed with pip to user locations are testable
# https://bugzilla.redhat.com/2152171
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-28 10:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 10:36 [rpms/pytest] rawhide: Fix 1 remaining test failure with Python 3.15
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox