summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_bz2.py')
-rw-r--r--Lib/test/test_bz2.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index 450ab2e..46ad2c4 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -821,6 +821,12 @@ class BZ2DecompressorTest(BaseTest):
out.append(bzd.decompress(self.DATA[300:]))
self.assertEqual(b''.join(out), self.TEXT)
+ def test_failure(self):
+ bzd = BZ2Decompressor()
+ self.assertRaises(Exception, bzd.decompress, self.BAD_DATA * 30)
+ # Previously, a second call could crash due to internal inconsistency
+ self.assertRaises(Exception, bzd.decompress, self.BAD_DATA * 30)
+
class CompressDecompressTest(BaseTest):
def testCompress(self):
data = bz2.compress(self.TEXT)