diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-15 14:03:42 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-15 14:03:42 +0200 |
commit | e9a021b7a1bac62ece03b5a0456675ea8dc0e54b (patch) | |
tree | 940a2f1cfd1a1bc5ce7a9ffad4acfac9efa0a31e /Lib/test/test_functools.py | |
parent | d864297e20d1c05000cf639d6a09509c6c976717 (diff) | |
download | cpython-e9a021b7a1bac62ece03b5a0456675ea8dc0e54b.tar.gz |
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r-- | Lib/test/test_functools.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index a7e5c7e3ef..10120530b8 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -182,8 +182,9 @@ class TestPartialC(TestPartial, unittest.TestCase): def test_pickle(self): f = self.partial(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): |