summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_archive_util.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2009-09-12 14:43:43 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2009-09-12 14:43:43 (GMT)
commit1036a7f7e180ac3fd98e43832a04e38b4c7c9e83 (patch)
treeeab29c294a6bbc075d44281c91d7ae433f3c96d0 /Lib/distutils/tests/test_archive_util.py
parent21121e64b4245e51b85b9d2bc9b29acb86ae79eb (diff)
downloadcpython-1036a7f7e180ac3fd98e43832a04e38b4c7c9e83.zip
cpython-1036a7f7e180ac3fd98e43832a04e38b4c7c9e83.tar.gz
cpython-1036a7f7e180ac3fd98e43832a04e38b4c7c9e83.tar.bz2
#6026 - fix tests that failed without zlib
Diffstat (limited to 'Lib/distutils/tests/test_archive_util.py')
-rw-r--r--Lib/distutils/tests/test_archive_util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
index 91bc4e3..d6fb676 100644
--- a/Lib/distutils/tests/test_archive_util.py
+++ b/Lib/distutils/tests/test_archive_util.py
@@ -19,10 +19,18 @@ try:
except ImportError:
ZIP_SUPPORT = find_executable('zip')
+# some tests will fail if zlib is not available
+try:
+ import zlib
+except ImportError:
+ zlib = None
+
+
class ArchiveUtilTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
+ @unittest.skipUnless(zlib, "Requires zlib")
def test_make_tarball(self):
# creating something to tar
tmpdir = self.mkdtemp()
@@ -83,6 +91,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
base_name = os.path.join(tmpdir2, 'archive')
return tmpdir, tmpdir2, base_name
+ @unittest.skipUnless(zlib, "Requires zlib")
@unittest.skipUnless(find_executable('tar') and find_executable('gzip'),
'Need the tar command to run')
def test_tarfile_vs_tar(self):
@@ -168,6 +177,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
self.assertTrue(not os.path.exists(tarball))
self.assertEquals(len(w.warnings), 1)
+ @unittest.skipUnless(zlib, "Requires zlib")
@unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run')
def test_make_zipfile(self):
# creating something to tar