File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -721,10 +721,10 @@ def testEOFError(self):
721721 @bigmemtest (size = _4G + 100 , memuse = 3.3 )
722722 def testDecompress4G (self , size ):
723723 # "Test BZ2Decompressor.decompress() with >4GiB input"
724- blocksize = 10 * 1024 * 1024
724+ blocksize = min ( 10 * 1024 * 1024 , size )
725725 block = random .randbytes (blocksize )
726726 try :
727- data = block * (size // blocksize + 1 )
727+ data = block * (( size - 1 ) // blocksize + 1 )
728728 compressed = bz2 .compress (data )
729729 bz2d = BZ2Decompressor ()
730730 decompressed = bz2d .decompress (compressed )
Original file line number Diff line number Diff line change @@ -352,10 +352,10 @@ def test_compressor_bigmem(self, size):
352352 @bigmemtest (size = _4G + 100 , memuse = 3 )
353353 def test_decompressor_bigmem (self , size ):
354354 lzd = LZMADecompressor ()
355- blocksize = 10 * 1024 * 1024
355+ blocksize = min ( 10 * 1024 * 1024 , size )
356356 block = random .randbytes (blocksize )
357357 try :
358- input = block * (size // blocksize + 1 )
358+ input = block * (( size - 1 ) // blocksize + 1 )
359359 cdata = lzma .compress (input )
360360 ddata = lzd .decompress (cdata )
361361 self .assertEqual (ddata , input )
Original file line number Diff line number Diff line change @@ -989,10 +989,10 @@ def testEOFError(self):
989989 @bigmemtest (size = _4G + 100 , memuse = 3.3 )
990990 def testDecompress4G (self , size ):
991991 # "Test zlib._ZlibDecompressor.decompress() with >4GiB input"
992- blocksize = 10 * 1024 * 1024
992+ blocksize = min ( 10 * 1024 * 1024 , size )
993993 block = random .randbytes (blocksize )
994994 try :
995- data = block * (size // blocksize + 1 )
995+ data = block * (( size - 1 ) // blocksize + 1 )
996996 compressed = zlib .compress (data )
997997 zlibd = zlib ._ZlibDecompressor ()
998998 decompressed = zlibd .decompress (compressed )
You can’t perform that action at this time.
0 commit comments