mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-108418: Speed up bigmem compression tests in dry mode (GH-108419)
Only generate and compress small amount of random data in dry run.
This commit is contained in:
parent
e59a95238b
commit
4ae3edf300
3 changed files with 6 additions and 6 deletions
|
@ -352,10 +352,10 @@ class CompressorDecompressorTestCase(unittest.TestCase):
|
|||
@bigmemtest(size=_4G + 100, memuse=3)
|
||||
def test_decompressor_bigmem(self, size):
|
||||
lzd = LZMADecompressor()
|
||||
blocksize = 10 * 1024 * 1024
|
||||
blocksize = min(10 * 1024 * 1024, size)
|
||||
block = random.randbytes(blocksize)
|
||||
try:
|
||||
input = block * (size // blocksize + 1)
|
||||
input = block * ((size-1) // blocksize + 1)
|
||||
cdata = lzma.compress(input)
|
||||
ddata = lzd.decompress(cdata)
|
||||
self.assertEqual(ddata, input)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue