@@ -462,20 +462,14 @@ def test_clear_unconsumed_tail(self):
462
462
def test_flushes (self ):
463
463
# Test flush() with the various options, using all the
464
464
# 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' ]
472
466
473
467
sync_opt = [getattr (isal_zlib , opt ) for opt in sync_opt
474
468
if hasattr (isal_zlib , opt )]
475
469
data = HAMLET_SCENE * 8
476
470
477
471
for sync in sync_opt :
478
- for level in range (10 ):
472
+ for level in range (3 ):
479
473
try :
480
474
obj = isal_zlib .compressobj ( level )
481
475
a = obj .compress ( data [:3000 ] )
@@ -486,7 +480,8 @@ def test_flushes(self):
486
480
print ("Error for flush mode={}, level={}"
487
481
.format (sync , level ))
488
482
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 ,
490
485
data , ("Decompress failed: flush "
491
486
"mode=%i, level=%i" ) % (sync , level ))
492
487
del obj
0 commit comments