Skip to content

Commit bb55157

Browse files
gh-74876: Skip weakref pickling tests in test_xpickle for Python < 3.16 (GH-160082)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 31a7d99 commit bb55157

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎Lib/test/pickletester.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3638,6 +3638,8 @@ def test_newobj_proxies(self):
36383638
self.assertEqual(x.__dict__, y.__dict__, detail)
36393639

36403640
def test_weakref(self):
3641+
if self.py_version < (3, 16):
3642+
self.skipTest('not supported in Python < 3.16')
36413643
obj = WeakrefTarget()
36423644
wr = weakref.ref(obj)
36433645
for proto in protocols:
@@ -3650,6 +3652,8 @@ def test_weakref(self):
36503652
self.assertIs(wr2(), obj2)
36513653

36523654
def test_weakref_callback(self):
3655+
if self.py_version < (3, 16):
3656+
self.skipTest('not supported in Python < 3.16')
36533657
# The callback is not preserved: pickling it strongly would defeat
36543658
# the weak-only detection.
36553659
obj = WeakrefTarget()
@@ -3661,6 +3665,8 @@ def test_weakref_callback(self):
36613665
self.assertIsNone(wr2.__callback__)
36623666

36633667
def test_dead_weakref(self):
3668+
if self.py_version < (3, 16):
3669+
self.skipTest('not supported in Python < 3.16')
36643670
# A dead reference stays dead, and all dead references unpickle as
36653671
# the same object.
36663672
obj = WeakrefTarget()

0 commit comments

Comments
 (0)