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

Method testCompress4G

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

Source from the content-addressed store, hash-verified

858 @support.skip_if_pgo_task
859 @bigmemtest(size=_4G + 100, memuse=2)
860 def testCompress4G(self, size):
861 # "Test BZ2Compressor.compress()/flush() with >4GiB input"
862 bz2c = BZ2Compressor()
863 data = b"x" * size
864 try:
865 compressed = bz2c.compress(data)
866 compressed += bz2c.flush()
867 finally:
868 data = None # Release memory
869 data = bz2.decompress(compressed)
870 try:
871 self.assertEqual(len(data), size)
872 self.assertEqual(len(data.strip(b"x")), 0)
873 finally:
874 data = None
875
876 def testPickle(self):
877 for proto in range(pickle.HIGHEST_PROTOCOL + 1):

Callers

nothing calls this directly

Calls 5

decompressMethod · 0.80
compressMethod · 0.45
flushMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected