Skip tests that require zlib in the packaging tests. Also add a requires_zlib decorator to test.support.
diff --git a/Lib/test/support.py b/Lib/test/support.py
index e49453e..3f60d55 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -28,6 +28,11 @@
except ImportError:
_thread = None
+try:
+ import zlib
+except ImportError:
+ zlib = None
+
__all__ = [
"Error", "TestFailed", "ResourceDenied", "import_module",
"verbose", "use_resources", "max_memuse", "record_original_stdout",
@@ -43,7 +48,7 @@
"threading_cleanup", "reap_children", "cpython_only", "check_impl_detail",
"get_attribute", "swap_item", "swap_attr", "requires_IEEE_754",
"TestHandler", "Matcher", "can_symlink", "skip_unless_symlink",
- "import_fresh_module"
+ "import_fresh_module", "requires_zlib"
]
class Error(Exception):
@@ -401,6 +406,8 @@
float.__getformat__("double").startswith("IEEE"),
"test requires IEEE 754 doubles")
+requires_zlib = unittest.skipUnless(zlib, 'requires zlib')
+
is_jython = sys.platform.startswith('java')
# Filename used for testing