diff Lib/test/support.py @ 76895:fccdcd83708a

Issue #14366: Support lzma compression in zip files. Patch by Serhiy Storchaka.
author Martin v. Löwis <martin@v.loewis.de>
date Sun, 13 May 2012 10:06:36 +0200
parents 85824b819bcb
children 347735ec92eb
line wrap: on
line diff
--- a/Lib/test/support.py	Sat May 12 23:44:59 2012 +0200
+++ b/Lib/test/support.py	Sun May 13 10:06:36 2012 +0200
@@ -45,6 +45,11 @@
 except ImportError:
     bz2 = None
 
+try:
+    import lzma
+except ImportError:
+    lzma = None
+
 __all__ = [
     "Error", "TestFailed", "ResourceDenied", "import_module",
     "verbose", "use_resources", "max_memuse", "record_original_stdout",
@@ -62,7 +67,7 @@
     "get_attribute", "swap_item", "swap_attr", "requires_IEEE_754",
     "TestHandler", "Matcher", "can_symlink", "skip_unless_symlink",
     "import_fresh_module", "requires_zlib", "PIPE_MAX_SIZE", "failfast",
-    "anticipate_failure", "run_with_tz", "requires_bz2"
+    "anticipate_failure", "run_with_tz", "requires_bz2", "requires_lzma"
     ]
 
 class Error(Exception):
@@ -513,6 +518,8 @@
 
 requires_bz2 = unittest.skipUnless(bz2, 'requires bz2')
 
+requires_lzma = unittest.skipUnless(lzma, 'requires lzma')
+
 is_jython = sys.platform.startswith('java')
 
 # Filename used for testing