summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gzip.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-09-11 11:41:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-09-11 11:41:02 (GMT)
commit5f1a5187f72acb75d59fa67286ecf5c186bae619 (patch)
treec5bca32d17d3251b8887ddaa10273a7df19a0eaa /Lib/test/test_gzip.py
parentab8740058a7f76f1438dc18a2ffd918da4f8118d (diff)
downloadcpython-5f1a5187f72acb75d59fa67286ecf5c186bae619.zip
cpython-5f1a5187f72acb75d59fa67286ecf5c186bae619.tar.gz
cpython-5f1a5187f72acb75d59fa67286ecf5c186bae619.tar.bz2
Use sequence repetition instead of bytes constructor with integer argument.
Diffstat (limited to 'Lib/test/test_gzip.py')
-rw-r--r--Lib/test/test_gzip.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index 3c51673..07a9f6f 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -434,12 +434,12 @@ class TestGzip(BaseTest):
def test_decompress_limited(self):
"""Decompressed data buffering should be limited"""
- bomb = gzip.compress(bytes(int(2e6)), compresslevel=9)
+ bomb = gzip.compress(b'\0' * int(2e6), compresslevel=9)
self.assertLess(len(bomb), io.DEFAULT_BUFFER_SIZE)
bomb = io.BytesIO(bomb)
decomp = gzip.GzipFile(fileobj=bomb)
- self.assertEqual(bytes(1), decomp.read(1))
+ self.assertEqual(decomp.read(1), b'\0')
max_decomp = 1 + io.DEFAULT_BUFFER_SIZE
self.assertLessEqual(decomp._buffer.raw.tell(), max_decomp,
"Excessive amount of data was decompressed")