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

Method testCompress4G

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

Source from the content-addressed store, hash-verified

849 @support.skip_if_pgo_task
850 @bigmemtest(size=_4G + 100, memuse=2)
851 def testCompress4G(self, size):
852 # "Test BZ2Compressor.compress()/flush() with >4GiB input"
853 bz2c = BZ2Compressor()
854 data = b"x" * size
855 try:
856 compressed = bz2c.compress(data)
857 compressed += bz2c.flush()
858 finally:
859 data = None # Release memory
860 data = bz2.decompress(compressed)
861 try:
862 self.assertEqual(len(data), size)
863 self.assertEqual(len(data.strip(b"x")), 0)
864 finally:
865 data = None
866
867 def testPickle(self):
868 for proto in range(pickle.HIGHEST_PROTOCOL + 1):

Callers

nothing calls this directly

Calls 7

compressMethod · 0.95
flushMethod · 0.95
BZ2CompressorClass · 0.90
lenFunction · 0.85
decompressMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected