https://github.com/python/cpython/commit/cfb1b2f0cb999558a30e61a9e1a62fdb7f55f6a4
commit: cfb1b2f0cb999558a30e61a9e1a62fdb7f55f6a4
branch: main
author: simple-is-great <[email protected]>
committer: corona10 <[email protected]>
date: 2024-11-02T08:27:07Z
summary:
gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321)
files:
M Lib/test/test_zlib.py
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 8b4bb8750f8f5c..4d97fe56f3a094 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -505,20 +505,16 @@ def test_flushes(self):
for sync in sync_opt:
for level in range(10):
- try:
+ with self.subTest(sync=sync, level=level):
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))
- del obj
+ self.assertEqual(zlib.decompress(b''.join([a,b,c,d])),
+ data, ("Decompress failed: flush "
+ "mode=%i, level=%i") % (sync,
level))
+ del obj
@unittest.skipUnless(hasattr(zlib, 'Z_SYNC_FLUSH'),
'requires zlib.Z_SYNC_FLUSH')
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]