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

Method testDecompress4G

Lib/test/test_zlib.py:1094–1107  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

1092 @support.skip_if_pgo_task
1093 @bigmemtest(size=_4G + 100, memuse=3.3)
1094 def testDecompress4G(self, size):
1095 # "Test zlib._ZlibDecompressor.decompress() with >4GiB input"
1096 blocksize = min(10 * 1024 * 1024, size)
1097 block = random.randbytes(blocksize)
1098 try:
1099 data = block * ((size-1) // blocksize + 1)
1100 compressed = zlib.compress(data)
1101 zlibd = zlib._ZlibDecompressor()
1102 decompressed = zlibd.decompress(compressed)
1103 self.assertTrue(decompressed == data)
1104 finally:
1105 data = None
1106 compressed = None
1107 decompressed = None
1108
1109 def testPickle(self):
1110 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