mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-34582: Update syntax of Azure Pipelines builds (GH-9521)
This commit is contained in:
parent
2d3ff2b5ea
commit
57675090b0
18 changed files with 503 additions and 542 deletions
|
@ -436,18 +436,29 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
|
|||
# Test flush() with the various options, using all the
|
||||
# different levels in order to provide more variations.
|
||||
sync_opt = ['Z_NO_FLUSH', 'Z_SYNC_FLUSH', 'Z_FULL_FLUSH',
|
||||
'Z_PARTIAL_FLUSH', 'Z_BLOCK']
|
||||
'Z_PARTIAL_FLUSH']
|
||||
|
||||
ver = tuple(int(v) for v in zlib.ZLIB_RUNTIME_VERSION.split('.'))
|
||||
# Z_BLOCK has a known failure prior to 1.2.5.3
|
||||
if ver >= (1, 2, 5, 3):
|
||||
sync_opt.append('Z_BLOCK')
|
||||
|
||||
sync_opt = [getattr(zlib, opt) for opt in sync_opt
|
||||
if hasattr(zlib, opt)]
|
||||
data = HAMLET_SCENE * 8
|
||||
|
||||
for sync in sync_opt:
|
||||
for level in range(10):
|
||||
obj = zlib.compressobj( level )
|
||||
a = obj.compress( data[:3000] )
|
||||
b = obj.flush( sync )
|
||||
c = obj.compress( data[3000:] )
|
||||
d = obj.flush()
|
||||
try:
|
||||
obj = zlib.compressobj( level )
|
||||
a = obj.compress( data[:3000] )
|
||||
b = obj.flush( sync )
|
||||
c = obj.compress( data[3000:] )
|
||||
d = obj.flush()
|
||||
except:
|
||||
print("Error for flush mode={}, level={}"
|
||||
.format(sync, level))
|
||||
raise
|
||||
self.assertEqual(zlib.decompress(b''.join([a,b,c,d])),
|
||||
data, ("Decompress failed: flush "
|
||||
"mode=%i, level=%i") % (sync, level))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue