Issue #22777: Test pickling with all protocols.
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 445ad9e..c0a9a3b 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -146,8 +146,9 @@
def test_pickle(self):
f = self.thetype(signature, 'asdf', bar=True)
f.add_something_to__dict__ = True
- f_copy = pickle.loads(pickle.dumps(f))
- self.assertEqual(signature(f), signature(f_copy))
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ f_copy = pickle.loads(pickle.dumps(f, proto))
+ self.assertEqual(signature(f), signature(f_copy))
# Issue 6083: Reference counting bug
def test_setstate_refcount(self):