summaryrefslogtreecommitdiff
path: root/Lib/test/test_lzma.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-15 14:03:42 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-15 14:03:42 +0200
commite9a021b7a1bac62ece03b5a0456675ea8dc0e54b (patch)
tree940a2f1cfd1a1bc5ce7a9ffad4acfac9efa0a31e /Lib/test/test_lzma.py
parentd864297e20d1c05000cf639d6a09509c6c976717 (diff)
downloadcpython-e9a021b7a1bac62ece03b5a0456675ea8dc0e54b.tar.gz
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/test_lzma.py')
-rw-r--r--Lib/test/test_lzma.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py
index 3e73d7f1cf..07fadbde11 100644
--- a/Lib/test/test_lzma.py
+++ b/Lib/test/test_lzma.py
@@ -220,10 +220,11 @@ class CompressorDecompressorTestCase(unittest.TestCase):
# Pickling raises an exception; there's no way to serialize an lzma_stream.
def test_pickle(self):
- with self.assertRaises(TypeError):
- pickle.dumps(LZMACompressor())
- with self.assertRaises(TypeError):
- pickle.dumps(LZMADecompressor())
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ with self.assertRaises(TypeError):
+ pickle.dumps(LZMACompressor(), proto)
+ with self.assertRaises(TypeError):
+ pickle.dumps(LZMADecompressor(), proto)
class CompressDecompressFunctionTestCase(unittest.TestCase):