mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
bpo-40286: Use random.randbytes() in tests (GH-19575)
This commit is contained in:
parent
223221b290
commit
87502ddd71
5 changed files with 9 additions and 28 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue