https://github.com/python/cpython/commit/2133e16bfe6d0a93c26873e82fd52a27bbf75774
commit: 2133e16bfe6d0a93c26873e82fd52a27bbf75774
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2026-02-21T13:05:35+01:00
summary:
gh-141510: Fix test_xpickle for Python 3.14 and older (#145069)
Skip tests on frozendict on Python 3.14 and older.
files:
M Lib/test/pickletester.py
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 0624b6a0257829..6ac4b19da3ea9c 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -2925,9 +2925,13 @@ def _test_recursive_collection_in_key(self, factory,
minprotocol=0):
self.assertIs(keys[0].attr, x)
def test_recursive_frozendict_in_key(self):
+ if self.py_version < (3, 15):
+ self.skipTest('need frozendict')
self._test_recursive_collection_in_key(frozendict, minprotocol=2)
def test_recursive_frozendict_subclass_in_key(self):
+ if self.py_version < (3, 15):
+ self.skipTest('need frozendict')
self._test_recursive_collection_in_key(MyFrozenDict)
def _test_recursive_collection_in_value(self, factory, minprotocol=0):
@@ -2942,9 +2946,13 @@ def _test_recursive_collection_in_value(self, factory,
minprotocol=0):
self.assertIs(x['key'][0], x)
def test_recursive_frozendict_in_value(self):
+ if self.py_version < (3, 15):
+ self.skipTest('need frozendict')
self._test_recursive_collection_in_value(frozendict, minprotocol=2)
def test_recursive_frozendict_subclass_in_value(self):
+ if self.py_version < (3, 15):
+ self.skipTest('need frozendict')
self._test_recursive_collection_in_value(MyFrozenDict)
def test_recursive_inst_state(self):
@@ -3437,6 +3445,8 @@ def test_newobj_generic(self):
self.skipTest('int and str subclasses are not
interoperable with Python 2')
if (3, 0) <= self.py_version < (3, 4) and proto < 2 and C
in (MyStr, MyUnicode):
self.skipTest('str subclasses are not interoperable
with Python < 3.4')
+ if self.py_version < (3, 15) and C == MyFrozenDict:
+ self.skipTest('frozendict is not available on Python <
3.15')
B = C.__base__
x = C(C.sample)
x.foo = 42
@@ -3458,6 +3468,8 @@ def test_newobj_proxies(self):
with self.subTest(proto=proto, C=C):
if self.py_version < (3, 4) and proto < 3 and C in (MyStr,
MyUnicode):
self.skipTest('str subclasses are not interoperable
with Python < 3.4')
+ if self.py_version < (3, 15) and C == MyFrozenDict:
+ self.skipTest('frozendict is not available on Python <
3.15')
B = C.__base__
x = C(C.sample)
x.foo = 42
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]