diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-15 12:03:42 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-15 12:03:42 (GMT) |
commit | bad1257c96943dcb39584a41e1a178542479df97 (patch) | |
tree | dbb4594291c7df3660da701eb062bec35446bcba /Lib/test/test_lzma.py | |
parent | 79b81738ef052e9406adb8e98f0d292928053c01 (diff) | |
download | cpython-bad1257c96943dcb39584a41e1a178542479df97.zip cpython-bad1257c96943dcb39584a41e1a178542479df97.tar.gz cpython-bad1257c96943dcb39584a41e1a178542479df97.tar.bz2 |
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/test_lzma.py')
-rw-r--r-- | Lib/test/test_lzma.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py index 3e73d7f..07fadbd 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): |