bpo-40286: Use random.randbytes() in tests (GH-19575)

This commit is contained in:
Victor Stinner 2020-04-17 22:54:38 +02:00 committed by GitHub
parent 223221b290
commit 87502ddd71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 28 deletions

View file

@ -710,7 +710,7 @@ class BZ2DecompressorTest(BaseTest):
def testDecompress4G(self, size):
# "Test BZ2Decompressor.decompress() with >4GiB input"
blocksize = 10 * 1024 * 1024
block = random.getrandbits(blocksize * 8).to_bytes(blocksize, 'little')
block = random.randbytes(blocksize)
try:
data = block * (size // blocksize + 1)
compressed = bz2.compress(data)