public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-pydantic-core] rawhide: Fix test_exceptions_and_markers_report_python_references
@ 2026-11-23 10:22 Benjamin A. Beasley
0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-11-23 10:22 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-pydantic-core
Branch : rawhide
Commit : 5c8c127c5282699633b8f1259b268081c6f7a5e2
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date : 2026-11-23T10:19:30+00:00
Stats : +52/-4 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-pydantic-core/c/5c8c127c5282699633b8f1259b268081c6f7a5e2?branch=rawhide
Log:
Fix test_exceptions_and_markers_report_python_references
---
diff --git a/pydantic-core-2.50.5-pr-14383.patch b/pydantic-core-2.50.5-pr-14383.patch
new file mode 100644
index 0000000..bb948a5
--- /dev/null
+++ b/pydantic-core-2.50.5-pr-14383.patch
@@ -0,0 +1,43 @@
+From 4daf8820cf999b6df217f0797bdcf9bef734898b Mon Sep 17 00:00:00 2001
+From: Victorien <65306057+Viicos@users.noreply.github.com>
+Date: Mon, 23 Nov 2026 11:12:41 +0100
+Subject: [PATCH] Fix flaky
+ `test_exceptions_and_markers_report_python_references()` test (#14383)
+
+---
+ tests/test_garbage_collection.py | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/tests/test_garbage_collection.py b/tests/test_garbage_collection.py
+index 2e8b490ef3..a69cc17e3d 100644
+--- a/tests/test_garbage_collection.py
++++ b/tests/test_garbage_collection.py
+@@ -315,10 +315,7 @@ def _gc_reaches(obj: Any, target: Any, depth: int = 3) -> bool:
+ return any(r is target for r in referents) or any(_gc_reaches(r, target, depth - 1) for r in referents)
+
+
+-@pytest.mark.xfail(
+- reason="'ArgsKwargs' uses a freelist, and GC is broken on reused objects from the freelist (https://github.com/PyO3/pyo3/pull/6442)"
+-)
+-def test_exceptions_and_markers_report_python_references() -> None:
++def test_exceptions_report_python_references() -> None:
+ """https://github.com/pydantic/pydantic/issues/14237"""
+ marker = object()
+
+@@ -330,6 +327,16 @@ def test_exceptions_and_markers_report_python_references() -> None:
+ assert gc.is_tracked(known_error)
+ assert _gc_reaches(known_error, marker)
+
++
++@pytest.mark.xfail(
++ reason="'ArgsKwargs' uses a freelist, and GC is broken on reused objects from the freelist (https://github.com/PyO3/pyo3/pull/6442)"
++)
++def test_args_kwargs_reports_python_references():
++ marker = object()
++
++ # Create an initial instance so that next ones will be taken from the freelist:
++ ArgsKwargs(())
++
+ args_kwargs = ArgsKwargs((marker,), {'kw': marker})
+ assert gc.is_tracked(args_kwargs)
+ assert _gc_reaches(args_kwargs, marker)
diff --git a/python-pydantic-core.spec b/python-pydantic-core.spec
index 2e41ea3..29f0f57 100644
--- a/python-pydantic-core.spec
+++ b/python-pydantic-core.spec
@@ -39,6 +39,15 @@ License: %{upstream_license}
URL: https://github.com/pydantic/pydantic
Source: %{pypi_source pydantic_core}
+# Fix flaky `test_exceptions_and_markers_report_python_references()` test
+# https://github.com/pydantic/pydantic/commit/4daf8820cf999b6df217f0797bdcf9bef734898b
+#
+# Fixes:
+#
+# Test test_exceptions_and_markers_report_python_references may pass unexpectedly
+# https://github.com/pydantic/pydantic/issues/14345
+Patch: pydantic-core-2.50.5-pr-14383.patch
+
BuildRequires: cargo-rpm-macros
BuildRequires: tomcli
@@ -149,10 +158,6 @@ ignore="${ignore-} --ignore=tests/test_docstrings.py"
# Due to patching out the pytest-timeout dependency:
warningsfilter="${warningsfilter-} -W ignore::pytest.PytestUnknownMarkWarning"
-# Test test_exceptions_and_markers_report_python_references may pass unexpectedly
-# https://github.com/pydantic/pydantic/issues/14345
-k="${k-}${k+ and }not test_exceptions_and_markers_report_python_references"
-
%pytest ${warningsfilter-} ${ignore-} -k "${k-}" -rs
%endif
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 10:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 10:22 [rpms/python-pydantic-core] rawhide: Fix test_exceptions_and_markers_report_python_references Benjamin A. Beasley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox