summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:03:42 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:03:42 (GMT)
commitbad1257c96943dcb39584a41e1a178542479df97 (patch)
treedbb4594291c7df3660da701eb062bec35446bcba /Lib/test/test_bz2.py
parent79b81738ef052e9406adb8e98f0d292928053c01 (diff)
downloadcpython-bad1257c96943dcb39584a41e1a178542479df97.zip
cpython-bad1257c96943dcb39584a41e1a178542479df97.tar.gz
cpython-bad1257c96943dcb39584a41e1a178542479df97.tar.bz2
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/test_bz2.py')
-rw-r--r--Lib/test/test_bz2.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index 40d8425..ce012d6 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -646,8 +646,9 @@ class BZ2CompressorTest(BaseTest):
data = None
def testPickle(self):
- with self.assertRaises(TypeError):
- pickle.dumps(BZ2Compressor())
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ with self.assertRaises(TypeError):
+ pickle.dumps(BZ2Compressor(), proto)
class BZ2DecompressorTest(BaseTest):
@@ -702,8 +703,9 @@ class BZ2DecompressorTest(BaseTest):
decompressed = None
def testPickle(self):
- with self.assertRaises(TypeError):
- pickle.dumps(BZ2Decompressor())
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ with self.assertRaises(TypeError):
+ pickle.dumps(BZ2Decompressor(), proto)
class CompressDecompressTest(BaseTest):