summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-07-29 09:27:14 (GMT)
committerGitHub <noreply@github.com>2024-07-29 09:27:14 (GMT)
commitc26dd270f7c7301636b23d70afaaeabb2f52eedf (patch)
tree2325586beff512513708a31f7d12f2f5eaf1fe4a /Lib/test/pickletester.py
parentd113359341374a0d7e956aaf13f1659440851aa6 (diff)
downloadcpython-c26dd270f7c7301636b23d70afaaeabb2f52eedf.zip
cpython-c26dd270f7c7301636b23d70afaaeabb2f52eedf.tar.gz
cpython-c26dd270f7c7301636b23d70afaaeabb2f52eedf.tar.bz2
[3.13] gh-122311: Fix some error messages in pickle (GH-122386) (GH-122387)
(cherry picked from commit 3b034d26eb8480f8d12ae11f42d038d24cf8498a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 174f4ff..a2b49e6 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -1982,8 +1982,10 @@ class AbstractPicklingErrorTests:
pb = pickle.PickleBuffer(b"foobar")
for proto in range(0, 5):
with self.subTest(proto=proto):
- with self.assertRaises(pickle.PickleError):
+ with self.assertRaises(pickle.PickleError) as cm:
self.dumps(pb, proto)
+ self.assertEqual(str(cm.exception),
+ 'PickleBuffer can only be pickled with protocol >= 5')
def test_non_continuous_buffer(self):
if self.pickler is pickle._Pickler: