Skip to content

Commit bb9ebca

Browse files
committed
Make sure test works with isal
1 parent a1f74c8 commit bb9ebca

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tests/test_zlib_compliance.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -462,20 +462,14 @@ def test_clear_unconsumed_tail(self):
462462
def test_flushes(self):
463463
# Test flush() with the various options, using all the
464464
# different levels in order to provide more variations.
465-
sync_opt = ['Z_NO_FLUSH', 'Z_SYNC_FLUSH', 'Z_FULL_FLUSH',
466-
'Z_PARTIAL_FLUSH']
467-
468-
ver = tuple(int(v) for v in isal_zlib.ZLIB_RUNTIME_VERSION.split('.'))
469-
# Z_BLOCK has a known failure prior to 1.2.5.3
470-
if ver >= (1, 2, 5, 3):
471-
sync_opt.append('Z_BLOCK')
465+
sync_opt = ['Z_NO_FLUSH', 'Z_SYNC_FLUSH', 'Z_FULL_FLUSH']
472466

473467
sync_opt = [getattr(isal_zlib, opt) for opt in sync_opt
474468
if hasattr(isal_zlib, opt)]
475469
data = HAMLET_SCENE * 8
476470

477471
for sync in sync_opt:
478-
for level in range(10):
472+
for level in range(3):
479473
try:
480474
obj = isal_zlib.compressobj( level )
481475
a = obj.compress( data[:3000] )
@@ -486,7 +480,8 @@ def test_flushes(self):
486480
print("Error for flush mode={}, level={}"
487481
.format(sync, level))
488482
raise
489-
self.assertEqual(isal_zlib.decompress(b''.join([a,b,c,d])),
483+
result = isal_zlib.decompress(b''.join([a,b,c,d]))
484+
self.assertEqual(result,
490485
data, ("Decompress failed: flush "
491486
"mode=%i, level=%i") % (sync, level))
492487
del obj

0 commit comments

Comments
 (0)