MCPcopy Index your code
hub / github.com/python/cpython / testDecompress4G

Method testDecompress4G

Lib/test/test_bz2.py:919–932  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

917 @support.skip_if_pgo_task
918 @bigmemtest(size=_4G + 100, memuse=3.3)
919 def testDecompress4G(self, size):
920 # "Test BZ2Decompressor.decompress() with >4GiB input"
921 blocksize = min(10 * 1024 * 1024, size)
922 block = random.randbytes(blocksize)
923 try:
924 data = block * ((size-1) // blocksize + 1)
925 compressed = bz2.compress(data)
926 bz2d = BZ2Decompressor()
927 decompressed = bz2d.decompress(compressed)
928 self.assertTrue(decompressed == data)
929 finally:
930 data = None
931 compressed = None
932 decompressed = None
933
934 def testPickle(self):
935 for proto in range(pickle.HIGHEST_PROTOCOL + 1):

Callers

nothing calls this directly

Calls 4

decompressMethod · 0.80
assertTrueMethod · 0.80
randbytesMethod · 0.45
compressMethod · 0.45

Tested by

no test coverage detected