bpo-34582: Update syntax of Azure Pipelines builds (GH-9521)

This commit is contained in:
Steve Dower 2018-09-24 07:44:50 -04:00 committed by GitHub
parent 2d3ff2b5ea
commit 57675090b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 503 additions and 542 deletions

View file

@ -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))