Commit efa2e040 authored by Zachary Ware's avatar Zachary Ware

Issue19619: skip zlib error test when zlib not available

parent 2ee2c955
...@@ -2335,7 +2335,7 @@ transform_aliases = { ...@@ -2335,7 +2335,7 @@ transform_aliases = {
try: try:
import zlib import zlib
except ImportError: except ImportError:
pass zlib = None
else: else:
bytes_transform_encodings.append("zlib_codec") bytes_transform_encodings.append("zlib_codec")
transform_aliases["zlib_codec"] = ["zip", "zlib"] transform_aliases["zlib_codec"] = ["zip", "zlib"]
...@@ -2440,6 +2440,7 @@ class TransformCodecTest(unittest.TestCase): ...@@ -2440,6 +2440,7 @@ class TransformCodecTest(unittest.TestCase):
bad_input.decode("rot_13") bad_input.decode("rot_13")
self.assertIsNone(failure.exception.__cause__) self.assertIsNone(failure.exception.__cause__)
@unittest.skipUnless(zlib, "Requires zlib support")
def test_custom_zlib_error_is_wrapped(self): def test_custom_zlib_error_is_wrapped(self):
# Check zlib codec gives a good error for malformed input # Check zlib codec gives a good error for malformed input
msg = "^decoding with 'zlib_codec' codec failed" msg = "^decoding with 'zlib_codec' codec failed"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment