Skip tests that require zlib in the packaging tests. Also add a requires_zlib decorator to test.support.

This commit is contained in:
Ezio Melotti 2011-05-19 21:25:10 +03:00
parent ebbb14c1a1
commit cad648cbc9
7 changed files with 41 additions and 14 deletions

View file

@ -28,6 +28,11 @@ try:
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 @@ __all__ = [
"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 @@ requires_IEEE_754 = unittest.skipUnless(
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