MCPcopy Index your code
hub / github.com/RustPython/RustPython / testDecompress4G

Method testDecompress4G

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

Source from the content-addressed store, hash-verified

908 @support.skip_if_pgo_task
909 @bigmemtest(size=_4G + 100, memuse=3.3)
910 def testDecompress4G(self, size):
911 # "Test BZ2Decompressor.decompress() with >4GiB input"
912 blocksize = min(10 * 1024 * 1024, size)
913 block = random.randbytes(blocksize)
914 try:
915 data = block * ((size-1) // blocksize + 1)
916 compressed = bz2.compress(data)
917 bz2d = BZ2Decompressor()
918 decompressed = bz2d.decompress(compressed)
919 self.assertTrue(decompressed == data)
920 finally:
921 data = None
922 compressed = None
923 decompressed = None
924
925 def testPickle(self):
926 for proto in range(pickle.HIGHEST_PROTOCOL + 1):

Callers

nothing calls this directly

Calls 6

decompressMethod · 0.95
BZ2DecompressorClass · 0.90
minFunction · 0.85
assertTrueMethod · 0.80
randbytesMethod · 0.45
compressMethod · 0.45

Tested by

no test coverage detected